Remove the implementation of --extclasspath

PiperOrigin-RevId: 294480346
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java
index 2a40104..c039836 100644
--- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java
+++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/JavaLibraryBuildRequest.java
@@ -54,7 +54,6 @@
   private final ImmutableList<Path> sourcePath;
   private final ImmutableList<Path> classPath;
   private final ImmutableList<Path> bootClassPath;
-  private final ImmutableList<Path> extClassPath;
 
   private final ImmutableList<Path> processorPath;
   private final List<String> processorNames;
@@ -123,10 +122,7 @@
     }
     depsBuilder.addDepsArtifacts(asPaths(optionsParser.getDepsArtifacts()));
     depsBuilder.setPlatformJars(
-        ImmutableSet.<Path>builder()
-            .addAll(asPaths(optionsParser.getBootClassPath()))
-            .addAll(asPaths(optionsParser.getExtClassPath()))
-            .build());
+        optionsParser.getBootClassPath().stream().map(Paths::get).collect(toImmutableSet()));
     if (optionsParser.reduceClasspathMode() != OptionsParser.ReduceClasspathMode.NONE) {
       depsBuilder.setReduceClasspath();
     }
@@ -159,7 +155,6 @@
     this.classPath = asPaths(optionsParser.getClassPath());
     this.sourcePath = asPaths(optionsParser.getSourcePath());
     this.bootClassPath = asPaths(optionsParser.getBootClassPath());
-    this.extClassPath = asPaths(optionsParser.getExtClassPath());
     this.processorPath = asPaths(optionsParser.getProcessorPath());
     this.processorNames = optionsParser.getProcessorNames();
     this.builtinProcessorNames = ImmutableSet.copyOf(optionsParser.getBuiltinProcessorNames());
@@ -237,10 +232,6 @@
     return bootClassPath;
   }
 
-  public ImmutableList<Path> getExtClassPath() {
-    return extClassPath;
-  }
-
   public ImmutableList<Path> getProcessorPath() {
     return processorPath;
   }
@@ -318,11 +309,7 @@
         BlazeJavacArguments.builder()
             .classPath(classPath)
             .classOutput(getClassDir())
-            .bootClassPath(
-                ImmutableList.<Path>builder()
-                    .addAll(getBootClassPath())
-                    .addAll(getExtClassPath())
-                    .build())
+            .bootClassPath(getBootClassPath())
             .javacOptions(makeJavacArguments())
             .sourceFiles(ImmutableList.copyOf(getSourceFiles()))
             .processors(null)
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
index 5099acb..474391f 100644
--- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
+++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
@@ -17,6 +17,7 @@
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import com.google.common.base.Splitter;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import java.io.File;
 import java.io.IOException;
@@ -79,7 +80,6 @@
   private final List<String> classPath = new ArrayList<>();
   private final List<String> sourcePath = new ArrayList<>();
   private final List<String> bootClassPath = new ArrayList<>();
-  private final List<String> extClassPath = new ArrayList<>();
 
   private final List<String> processorPath = new ArrayList<>();
   private final List<String> processorNames = new ArrayList<>();
@@ -186,7 +186,8 @@
           break;
         case "--extclasspath":
         case "--extdir":
-          collectFlagArguments(extClassPath, argQueue, "-");
+          // TODO(b/149114743): delete once Blaze stops passing the flag
+          collectFlagArguments(new ArrayList<>(), argQueue, "-");
           break;
         case "--output":
           outputJar = getArgument(argQueue, arg);
@@ -416,12 +417,13 @@
     return bootClassPath;
   }
 
-  public List<String> getSourcePath() {
-    return sourcePath;
+  public List<String> getExtClassPath() {
+    // TODO(b/149114743): delete once Blaze stops accessing this in tests
+    return ImmutableList.of();
   }
 
-  public List<String> getExtClassPath() {
-    return extClassPath;
+  public List<String> getSourcePath() {
+    return sourcePath;
   }
 
   public List<String> getProcessorPath() {
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java
index 49b8ae8..38506c3 100644
--- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java
+++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/VanillaJavaBuilder.java
@@ -251,9 +251,7 @@
       OptionsParser optionsParser, StandardJavaFileManager fileManager, Path nativeHeaderDir)
       throws IOException {
     fileManager.setLocation(StandardLocation.CLASS_PATH, toFiles(optionsParser.getClassPath()));
-    Iterable<File> bootClassPath =
-        Iterables.concat(
-            toFiles(optionsParser.getBootClassPath()), toFiles(optionsParser.getExtClassPath()));
+    Iterable<File> bootClassPath = toFiles(optionsParser.getBootClassPath());
     // The bootclasspath may legitimately be empty if --release is being used.
     if (!Iterables.isEmpty(bootClassPath)) {
       fileManager.setLocation(StandardLocation.PLATFORM_CLASS_PATH, bootClassPath);