Pass the bootclasspath as a top-level JavaBuilder flag

instead of hiding inside javacopts, and then processing
javacopts to extract in JavaBuilder.

--
PiperOrigin-RevId: 149127902
MOS_MIGRATED_REVID=149127902
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
index 93b5bcf..ee053f1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCompileAction.java
@@ -613,6 +613,7 @@
       final Collection<Artifact> sourceJars,
       final Collection<Artifact> sourceFiles,
       final Collection<Artifact> extdirInputs,
+      final Collection<Artifact> bootclasspathEntries,
       final List<String> javacOpts,
       final String ruleKind,
       final Label targetLabel,
@@ -647,6 +648,9 @@
         if (!extdirInputs.isEmpty()) {
           result.addJoinExecPaths("--extdir", pathSeparator, extdirInputs);
         }
+        if (!bootclasspathEntries.isEmpty()) {
+          result.addJoinExecPaths("--bootclasspath", pathSeparator, bootclasspathEntries);
+        }
         if (!processorPath.isEmpty() || !processorPathDirs.isEmpty()) {
           ImmutableList.Builder<String> execPathStrings = ImmutableList.<String>builder();
           execPathStrings.addAll(Artifact.toExecPaths(processorPath));
@@ -663,7 +667,8 @@
           for (Artifact message : messages) {
             addAsResourcePrefixedExecPath(
                 semantics.getDefaultJavaResourcePath(message.getRootRelativePath()),
-                message, result);
+                message,
+                result);
           }
         }
         if (!resources.isEmpty()) {
@@ -1015,13 +1020,8 @@
       // TODO(bazel-team): all the params should be calculated before getting here, and the various
       // aggregation code below should go away.
       final String pathSeparator = configuration.getHostPathSeparator();
-      List<String> jcopts = new ArrayList<>(javacOpts);
-      if (!bootclasspathEntries.isEmpty()) {
-        jcopts.add("-bootclasspath");
-        jcopts.add(Artifact.joinExecPaths(pathSeparator, bootclasspathEntries));
-      }
       final List<String> internedJcopts = new ArrayList<>();
-      for (String jcopt : jcopts) {
+      for (String jcopt : javacOpts) {
         internedJcopts.add(StringCanonicalizer.intern(jcopt));
       }
 
@@ -1078,30 +1078,32 @@
       }
       ImmutableList<Artifact> outputs = outputsBuilder.build();
 
-      CustomMultiArgv commonJavaBuilderArgs = commonJavaBuilderArgs(
-          semantics,
-          classDirectory,
-          sourceGenDirectory,
-          tempDirectory,
-          outputJar,
-          gensrcOutputJar,
-          manifestProtoOutput,
-          compressJar,
-          outputDepsProto,
-          processorPath,
-          processorPathDirs,
-          processorNames,
-          translations,
-          resources,
-          resourceJars,
-          classpathResources,
-          sourceJars,
-          sourceFiles,
-          extdirInputs,
-          internedJcopts,
-          ruleKind,
-          targetLabel,
-          pathSeparator);
+      CustomMultiArgv commonJavaBuilderArgs =
+          commonJavaBuilderArgs(
+              semantics,
+              classDirectory,
+              sourceGenDirectory,
+              tempDirectory,
+              outputJar,
+              gensrcOutputJar,
+              manifestProtoOutput,
+              compressJar,
+              outputDepsProto,
+              processorPath,
+              processorPathDirs,
+              processorNames,
+              translations,
+              resources,
+              resourceJars,
+              classpathResources,
+              sourceJars,
+              sourceFiles,
+              extdirInputs,
+              bootclasspathEntries,
+              internedJcopts,
+              ruleKind,
+              targetLabel,
+              pathSeparator);
 
       CustomCommandLine.Builder paramFileContentsBuilder = javaCompileCommandLine(
           commonJavaBuilderArgs,