Repository: kythe/kythe
Pull request #5230 (2022-03-02 18:32:36)

chore: remove Java 8 workarounds and resulting dead code


Patch:
diff --git a/kythe/extractors/openjdk11/extract/BUILD b/kythe/extractors/openjdk11/extract/BUILD
index 83e235f80..7c905bc7b 100644
--- a/kythe/extractors/openjdk11/extract/BUILD
+++ b/kythe/extractors/openjdk11/extract/BUILD
@@ -6,7 +6,7 @@ go_binary(
     data = [
         "//kythe/extractors/openjdk11:vnames.json",
         "//kythe/extractors/openjdk11/java_wrapper",
-        "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac9_extractor_deploy.jar",
+        "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac_extractor_deploy.jar",
     ],
     visibility = ["//visibility:public"],
     deps = [
diff --git a/kythe/java/com/google/devtools/kythe/analyzers/java/KytheTreeScanner.java b/kythe/java/com/google/devtools/kythe/analyzers/java/KytheTreeScanner.java
index f27145503..c3afb3e03 100644
--- a/kythe/java/com/google/devtools/kythe/analyzers/java/KytheTreeScanner.java
+++ b/kythe/java/com/google/devtools/kythe/analyzers/java/KytheTreeScanner.java
@@ -36,7 +36,6 @@ import com.google.devtools.kythe.analyzers.java.SourceText.Keyword;
 import com.google.devtools.kythe.analyzers.java.SourceText.Positions;
 import com.google.devtools.kythe.analyzers.jvm.JvmGraph;
 import com.google.devtools.kythe.analyzers.jvm.JvmGraph.Type.ReferenceType;
-import com.google.devtools.kythe.platform.java.filemanager.ForwardingStandardJavaFileManager;
 import com.google.devtools.kythe.platform.java.helpers.JCTreeScanner;
 import com.google.devtools.kythe.platform.java.helpers.JavacUtil;
 import com.google.devtools.kythe.platform.java.helpers.SignatureGenerator;
@@ -673,21 +672,7 @@ public class KytheTreeScanner extends JCTreeScanner<JavaNode, TreeContext> {
   }
 
   private static Iterable<Type> getTargets(JCFunctionalExpression node) {
-    try {
-      @SuppressWarnings("unchecked")
-      Iterable<Type> targets =
-          (Iterable<Type>) JCFunctionalExpression.class.getField("targets").get(node);
-      return targets != null ? targets : ImmutableList.of();
-    } catch (ReflectiveOperationException e) {
-      // continue below
-    }
-    try {
-      // Work with the field rename in JDK 11: http://hg.openjdk.java.net/jdk/jdk11/rev/f854b76b6a0c
-      return com.sun.tools.javac.util.List.of(
-          (Type) JCFunctionalExpression.class.getField("target").get(node));
-    } catch (ReflectiveOperationException e) {
-      throw new LinkageError(e.getMessage(), e);
-    }
+    return ImmutableList.of(node.target);
   }
 
   @Override
@@ -1686,16 +1671,8 @@ public class KytheTreeScanner extends JCTreeScanner<JavaNode, TreeContext> {
   /** Resovles a string as a source-file relative path */
   private String resolveSourcePath(String path) {
     try {
-      // TODO(shahms): Remove this cast/check/fallback when we only support JDK9+.
-      if (fileManager instanceof ForwardingStandardJavaFileManager) {
-        return ((ForwardingStandardJavaFileManager) fileManager)
-            .asPath(filePositions.getSourceFile())
-            .resolveSibling(path)
-            .toString();
-      }
-    } catch (UnsupportedOperationException
-        | IllegalArgumentException
-        | NullPointerException unused) {
+      return fileManager.asPath(filePositions.getSourceFile()).resolveSibling(path).toString();
+    } catch (UnsupportedOperationException unused) {
       // Do nothing; perform fallback below
     }
     // Fallback to URI-based path resolution when asPath is unsupported.
diff --git a/kythe/java/com/google/devtools/kythe/extractors/java/BUILD b/kythe/java/com/google/devtools/kythe/extractors/java/BUILD
index 2bbc59df4..d1f3fd4c3 100644
--- a/kythe/java/com/google/devtools/kythe/extractors/java/BUILD
+++ b/kythe/java/com/google/devtools/kythe/extractors/java/BUILD
@@ -45,7 +45,6 @@ java_library(
     name = "system_exploder",
     srcs = ["SystemExploder.java"],
     deps = [
-        "//kythe/java/com/google/devtools/kythe/platform/java/filemanager:forwarding_standard_java_file_manager",
         "//third_party/guava",
     ],
 )
diff --git a/kythe/java/com/google/devtools/kythe/extractors/java/JavaCompilationUnitExtractor.java b/kythe/java/com/google/devtools/kythe/extractors/java/JavaCompilationUnitExtractor.java
index deb8c19d9..8c76f9495 100644
--- a/kythe/java/com/google/devtools/kythe/extractors/java/JavaCompilationUnitExtractor.java
+++ b/kythe/java/com/google/devtools/kythe/extractors/java/JavaCompilationUnitExtractor.java
@@ -121,7 +121,7 @@ public class JavaCompilationUnitExtractor {
     return String.format("!%s_JAR!", location);
   }
 
-  private static final ClassLoader moduleClassLoader = findModuleClassLoader().orElse(null);
+  private static final ClassLoader moduleClassLoader = findModuleClassLoader();
 
   private static final String JAR_SCHEME = "jar";
   private final String jdkJar;
@@ -1034,21 +1034,11 @@ public class JavaCompilationUnitExtractor {
                     "Could not get system Java compiler; are you missing the JDK?"));
   }
 
-  private static Optional<ClassLoader> findModuleClassLoader() {
-    // TODO(shahms): Use the proper methods when we can rely on JDK 9.
-    try {
-      Object thisModule =
-          Class.class.getMethod("getModule").invoke(JavaCompilationUnitExtractor.class);
-      thisModule
-          .getClass()
-          .getMethod("addUses", Class.class)
-          .invoke(thisModule, JavaCompiler.class);
-      return Optional.ofNullable(
-          (ClassLoader) thisModule.getClass().getMethod("getClassLoader").invoke(thisModule));
-    } catch (ReflectiveOperationException e) {
-      logger.atInfo().log("Running on non-modular JDK, fallback compiler unavailable.");
-    }
-    return Optional.empty();
+  private static ClassLoader findModuleClassLoader() {
+    return JavaCompilationUnitExtractor.class
+        .getModule()
+        .addUses(JavaCompiler.class)
+        .getClassLoader();
   }
 
   /** Returns a map from a classfile's {@link URI} to its sourcefile path's basename. */
diff --git a/kythe/java/com/google/devtools/kythe/extractors/java/SystemExploder.java b/kythe/java/com/google/devtools/kythe/extractors/java/SystemExploder.java
index d8b50b8a6..1b73c08e2 100644
--- a/kythe/java/com/google/devtools/kythe/extractors/java/SystemExploder.java
+++ b/kythe/java/com/google/devtools/kythe/extractors/java/SystemExploder.java
@@ -19,7 +19,6 @@ package com.google.devtools.kythe.extractors.java;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Streams;
-import com.google.devtools.kythe.platform.java.filemanager.ForwardingStandardJavaFileManager;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -47,26 +46,17 @@ final class SystemExploder {
     copySystemModules(systemDir, Paths.get(outputDir));
   }
 
-  // In order to work around the lack of the required JDK9 methods in google3, wrap
-  // StandardJavaFileManagers before use (for now).
-  private static ForwardingStandardJavaFileManager wrap(StandardJavaFileManager fileManager) {
-    if (fileManager instanceof ForwardingStandardJavaFileManager) {
-      return (ForwardingStandardJavaFileManager) fileManager;
-    }
-    return new ForwardingStandardJavaFileManager(fileManager) {};
-  }
-
   // Returns a stream of paths from the specified --system directory, beginning with the appropriate
   // modules subdirectory.
   public static ImmutableList<Path> walkSystemModules(String systemDir) throws IOException {
     StandardJavaFileManager fileManager =
         ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null);
     fileManager.handleOption("--system", Iterators.singletonIterator(systemDir));
-    return walkSystemModules(wrap(fileManager));
+    return walkSystemModules(fileManager);
   }
 
-  private static ImmutableList<Path> walkSystemModules(
-      ForwardingStandardJavaFileManager fileManager) throws IOException {
+  private static ImmutableList<Path> walkSystemModules(StandardJavaFileManager fileManager)
+      throws IOException {
     JavaFileManager.Location systemLocation = StandardLocation.valueOf("SYSTEM_MODULES");
     ImmutableList.Builder<Path> modules = new ImmutableList.Builder<>();
     for (Set<JavaFileManager.Location> locs : fileManager.listLocationsForModules(systemLocation)) {
@@ -102,22 +92,20 @@ final class SystemExploder {
     }
   }
 
-  private static void dumpSystemPaths(ForwardingStandardJavaFileManager fileManager)
-      throws IOException {
+  private static void dumpSystemPaths(StandardJavaFileManager fileManager) throws IOException {
     for (Path path : walkSystemModules(fileManager)) {
       System.err.println(path.isAbsolute() ? path.subpath(0, path.getNameCount()) : path);
     }
   }
 
   private static void dumpSystemPaths() throws IOException {
-    dumpSystemPaths(
-        wrap(ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null)));
+    dumpSystemPaths(ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null));
   }
 
   private static void dumpSystemPaths(String systemDir) throws IOException {
     StandardJavaFileManager fileManager =
         ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null);
     fileManager.handleOption("--system", Iterators.singletonIterator(systemDir));
-    dumpSystemPaths(wrap(fileManager));
+    dumpSystemPaths(fileManager);
   }
 }
diff --git a/kythe/java/com/google/devtools/kythe/extractors/java/standalone/BUILD b/kythe/java/com/google/devtools/kythe/extractors/java/standalone/BUILD
index 95a065c7e..8b1a2f9f4 100644
--- a/kythe/java/com/google/devtools/kythe/extractors/java/standalone/BUILD
+++ b/kythe/java/com/google/devtools/kythe/extractors/java/standalone/BUILD
@@ -7,27 +7,12 @@ exports_files(["javac-wrapper.sh"])
 
 java_binary(
     name = "javac_extractor",
-    srcs = ["Javac8Wrapper.java"],
+    srcs = ["Javac9Wrapper.java"],
     javacopts = [
         "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
         "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
         "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
     ],
-    main_class = "com.google.devtools.kythe.extractors.java.standalone.Javac8Wrapper",
-    visibility = ["//visibility:public"],
-    deps = [
-        ":abstract_javac_wrapper",
-        "//kythe/java/com/google/devtools/kythe/extractors/java",
-        "//kythe/java/com/google/devtools/kythe/extractors/shared",
-        "//kythe/java/com/google/devtools/kythe/extractors/shared:environment",
-        "//kythe/proto:storage_java_proto",
-        "//third_party/guava",
-    ],
-)
-
-java_binary(
-    name = "javac9_extractor",
-    srcs = ["Javac9Wrapper.java"],
     main_class = "com.google.devtools.kythe.extractors.java.standalone.Javac9Wrapper",
     visibility = ["//visibility:public"],
     deps = [
@@ -37,7 +22,6 @@ java_binary(
         "//kythe/java/com/google/devtools/kythe/extractors/shared:environment",
         "//kythe/proto:storage_java_proto",
         "//third_party/guava",
-        "//third_party/javac:javac9",
     ],
 )
 
diff --git a/kythe/java/com/google/devtools/kythe/extractors/java/standalone/Javac8Wrapper.java b/kythe/java/com/google/devtools/kythe/extractors/java/standalone/Javac8Wrapper.java
deleted file mode 100644
index 56724ed5e..000000000
--- a/kythe/java/com/google/devtools/kythe/extractors/java/standalone/Javac8Wrapper.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.extractors.java.standalone;
-
-import static com.google.common.collect.ImmutableList.toImmutableList;
-
-import com.google.common.collect.Lists;
-import com.google.devtools.kythe.extractors.java.JavaCompilationUnitExtractor;
-import com.google.devtools.kythe.extractors.shared.CompilationDescription;
-import com.google.devtools.kythe.extractors.shared.EnvironmentUtils;
-import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.main.Arguments;
-import com.sun.tools.javac.main.Option;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.Options;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardLocation;
-
-/** A class that wraps javac to extract compilation information and write it to an index file. */
-public class Javac8Wrapper extends AbstractJavacWrapper {
-  @Override
-  protected Collection<CompilationDescription> processCompilation(
-      String[] arguments, JavaCompilationUnitExtractor javaCompilationUnitExtractor)
-      throws Exception {
-    // Use javac's argument parser to get the list of source files
-    Context context = new Context();
-
-    JavacFileManager fileManager = new JavacFileManager(context, true, null);
-    Arguments args = Arguments.instance(context);
-    args.init("kythe_javac", arguments);
-    fileManager.handleOptions(args.getDeferredFileManagerOptions());
-    Options options = Options.instance(context);
-
-    List<String> sources =
-        args.getFileObjects().stream().map(JavaFileObject::getName).collect(toImmutableList());
-
-    // Retrieve the list of class paths provided by the -classpath argument.
-    List<String> classPaths = splitPaths(options.get(Option.CLASS_PATH));
-
-    // Retrieve the list of source paths provided by the -sourcepath argument.
-    List<String> sourcePaths = splitPaths(options.get(Option.SOURCE_PATH));
-
-    // Retrieve the list of processor paths provided by the -processorpath argument.
-    List<String> processorPaths = splitPaths(options.get(Option.PROCESSOR_PATH));
-
-    // Retrieve the list of processors provided by the -processor argument.
-    List<String> processors = splitCSV(options.get(Option.PROCESSOR));
-
-    EnumSet<Option> claimed =
-        EnumSet.of(Option.CLASS_PATH, Option.SOURCE_PATH, Option.PROCESSOR_PATH, Option.PROCESSOR);
-
-    // Retrieve all other javac options.
-    List<String> completeOptions = new ArrayList<>();
-    for (Option opt : Option.values()) {
-      if (!claimed.contains(opt)) {
-        String value = options.get(opt);
-        if (value != null) {
-          if (opt.getPrimaryName().endsWith(":")) {
-            completeOptions.add(opt.getPrimaryName() + value);
-          } else {
-            completeOptions.add(opt.getPrimaryName());
-            if (!value.equals(opt.getPrimaryName())) {
-              completeOptions.add(value);
-            }
-          }
-        }
-      }
-    }
-
-    List<String> bootclasspath = new ArrayList<>();
-    for (File bcp : fileManager.getLocation(StandardLocation.PLATFORM_CLASS_PATH)) {
-      bootclasspath.add(bcp.toString());
-    }
-
-    // Get the output directory for this target.
-    String outputDirectory = options.get(Option.D);
-    if (outputDirectory == null) {
-      outputDirectory = ".";
-    }
-
-    int batchSize = readSourcesBatchSize().orElse(sources.size());
-    List<CompilationDescription> results = new ArrayList<>();
-    for (List<String> sourceBatch : Lists.partition(sources, batchSize)) {
-      String analysisTarget =
-          EnvironmentUtils.readEnvironmentVariable(
-              "KYTHE_ANALYSIS_TARGET", createTargetFromSourceFiles(sourceBatch));
-      results.add(
-          javaCompilationUnitExtractor.extract(
-              analysisTarget,
-              sourceBatch,
-              classPaths,
-              bootclasspath,
-              sourcePaths,
-              processorPaths,
-              processors,
-              completeOptions,
-              outputDirectory));
-    }
-    return results;
-  }
-
-  @Override
-  protected void passThrough(String[] args) throws Exception {
-    com.sun.tools.javac.Main.main(args);
-  }
-
-  public static void main(String[] args) {
-    new Javac8Wrapper().process(args);
-  }
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/BUILD b/kythe/java/com/google/devtools/kythe/platform/java/BUILD
index 712964624..a5a2649eb 100644
--- a/kythe/java/com/google/devtools/kythe/platform/java/BUILD
+++ b/kythe/java/com/google/devtools/kythe/platform/java/BUILD
@@ -16,7 +16,6 @@ java_library(
         ":options",
         "//kythe/java/com/google/devtools/kythe/common:flogger",
         "//kythe/java/com/google/devtools/kythe/platform/java/filemanager",
-        "//kythe/java/com/google/devtools/kythe/platform/java/filemanager:path_filemanager",
         "//kythe/java/com/google/devtools/kythe/platform/shared:analysis_exception",
         "//kythe/java/com/google/devtools/kythe/platform/shared:file_data",
         "//kythe/java/com/google/devtools/kythe/platform/shared:statistics",
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/JavaCompilationDetails.java b/kythe/java/com/google/devtools/kythe/platform/java/JavaCompilationDetails.java
index ae5947871..3d25706ed 100644
--- a/kythe/java/com/google/devtools/kythe/platform/java/JavaCompilationDetails.java
+++ b/kythe/java/com/google/devtools/kythe/platform/java/JavaCompilationDetails.java
@@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 import com.google.common.flogger.FluentLogger;
 import com.google.devtools.kythe.platform.java.JavacOptionsUtils.ModifiableOptions;
-import com.google.devtools.kythe.platform.java.filemanager.CompilationUnitBasedJavaFileManager;
 import com.google.devtools.kythe.platform.java.filemanager.CompilationUnitPathFileManager;
 import com.google.devtools.kythe.platform.shared.FileDataProvider;
 import com.google.devtools.kythe.proto.Analysis.CompilationUnit;
@@ -32,7 +31,6 @@ import com.sun.source.util.JavacTask;
 import com.sun.tools.javac.api.JavacTaskImpl;
 import java.io.IOException;
 import java.io.Writer;
-import java.lang.reflect.Method;
 import java.nio.charset.Charset;
 import java.nio.file.Path;
 import java.util.List;
@@ -77,22 +75,14 @@ public class JavaCompilationDetails implements AutoCloseable {
     List<String> options = optionsFromCompilationUnit(compilationUnit, processors);
     Charset encoding = JavacOptionsUtils.getEncodingOption(options);
 
-    // Create a CompilationUnitBasedJavaFileManager that uses the fileDataProvider and
+    // Create a CompilationUnitPathFileManager that uses the fileDataProvider and
     // compilationUnit
     StandardJavaFileManager fileManager =
-        // The Path-based JavaFileManager is only compatible with JDK9+ and for now,
-        // we have to remain compatible with JDK8.
-        isJdk9OrNewer()
-            ? new CompilationUnitPathFileManager(
-                compilationUnit,
-                fileDataProvider,
-                compiler.getStandardFileManager(diagnosticsCollector, null, null),
-                temporaryDirectory)
-            : new CompilationUnitBasedJavaFileManager(
-                fileDataProvider,
-                compilationUnit,
-                compiler.getStandardFileManager(diagnosticsCollector, null, null),
-                encoding);
+        new CompilationUnitPathFileManager(
+            compilationUnit,
+            fileDataProvider,
+            compiler.getStandardFileManager(diagnosticsCollector, null, null),
+            temporaryDirectory);
 
     Throwable analysisCrash = null;
     JavacTaskImpl javacTask = null;
@@ -227,18 +217,6 @@ public class JavaCompilationDetails implements AutoCloseable {
     return arguments.removeUnsupportedOptions().build();
   }
 
-  /** Returns true if the runtime version is >= JRE 9 */
-  private static boolean isJdk9OrNewer() {
-    try {
-      Method versionMethod = Runtime.class.getMethod("version");
-      Object version = versionMethod.invoke(null);
-      return ((int) version.getClass().getMethod("major").invoke(version) >= 9);
-    } catch (ReflectiveOperationException e) {
-      logger.atInfo().log("Falling back to legacy FileManager on JDK8 or older");
-      return false;
-    }
-  }
-
   private static boolean isErrorDiagnostic(Diagnostic<?> diag) {
     return diag.getKind() == Kind.ERROR;
   }
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/BUILD b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/BUILD
index 0bc41f7c3..1759ae025 100644
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/BUILD
+++ b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/BUILD
@@ -8,42 +8,10 @@ java_library(
     javacopts = [
         "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
     ],
-    deps = [
-        "//kythe/java/com/google/devtools/kythe/common:flogger",
-        "//third_party/guava",
-    ],
 )
 
 java_library(
     name = "filemanager",
-    srcs = [
-        "CompilationUnitBasedJavaFileManager.java",
-        "CompilationUnitBasedJavaFileStore.java",
-        "CustomFileObject.java",
-        "CustomJavaFileObject.java",
-        "JavaFileStore.java",
-        "JavaFileStoreBasedFileManager.java",
-    ],
-    javacopts = [
-        "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
-    ],
-    deps = [
-        ":filetree",
-        ":forwarding_standard_java_file_manager",
-        "//kythe/java/com/google/devtools/kythe/common:flogger",
-        "//kythe/java/com/google/devtools/kythe/extractors/java",
-        "//kythe/java/com/google/devtools/kythe/platform/shared:file_data",
-        "//kythe/proto:analysis_java_proto",
-        "//kythe/proto:java_java_proto",
-        "@com_google_protobuf//:any_proto",
-        "@com_google_protobuf//:protobuf_java",
-        "@maven//:com_google_guava_guava",
-        "@maven//:org_checkerframework_checker_qual",
-    ],
-)
-
-java_library(
-    name = "path_filemanager",
     srcs = ["CompilationUnitPathFileManager.java"],
     javacopts = [
         "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileManager.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileManager.java
deleted file mode 100644
index 107d5a70f..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileManager.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import com.google.common.flogger.FluentLogger;
-import com.google.devtools.kythe.extractors.java.JavaCompilationUnitExtractor;
-import com.google.devtools.kythe.platform.shared.FileDataProvider;
-import com.google.devtools.kythe.proto.Analysis.CompilationUnit;
-import com.google.devtools.kythe.proto.Java.JavaDetails;
-import com.google.protobuf.Any;
-import com.google.protobuf.InvalidProtocolBufferException;
-import java.nio.charset.Charset;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.StandardLocation;
-
-/**
- * Makes it easier for our analysis to provide files in different ways than on the local file system
- * e.g. from datastores or .index files. All users of this class have to do is provide a {@link
- * FileDataProvider} that will feed the actual content in as a future.
- */
-@com.sun.tools.javac.api.ClientCodeWrapper.Trusted
-public class CompilationUnitBasedJavaFileManager extends JavaFileStoreBasedFileManager {
-  private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-
-  /**
-   * paths searched for .class files, can be relative or absolute, but must match path as named by
-   * the extractor.
-   */
-  private final Set<String> classpath = new HashSet<>();
-
-  /**
-   * paths searched for .java files, can be relative or absolute, but must match path as named by
-   * the extractor.
-   */
-  private final Set<String> sourcepath = new HashSet<>();
-
-  private final Set<String> bootclasspath = new HashSet<>();
-
-  public CompilationUnitBasedJavaFileManager(
-      FileDataProvider contentProvider,
-      CompilationUnit unit,
-      StandardJavaFileManager fileManager,
-      Charset encoding) {
-    super(new CompilationUnitBasedJavaFileStore(unit, contentProvider, encoding), fileManager);
-
-    JavaDetails details = getDetails(unit);
-    if (details != null) {
-      classpath.addAll(details.getClasspathList());
-      sourcepath.addAll(details.getSourcepathList());
-      bootclasspath.addAll(details.getBootclasspathList());
-    } else {
-      logger.atWarning().log("Compilation missing JavaDetails; falling back to flag parsing");
-      classpath.add("");
-      classpath.addAll(getPathSet(unit.getArgumentList(), "-cp"));
-      classpath.addAll(getPathSet(unit.getArgumentList(), "-classpath"));
-      sourcepath.add("");
-      sourcepath.addAll(getPathSet(unit.getArgumentList(), "-sourcepath"));
-      bootclasspath.add("");
-      bootclasspath.addAll(getPathSet(unit.getArgumentList(), "-bootclasspath"));
-    }
-  }
-
-  @Override
-  protected Set<String> getSearchPaths(Location location) {
-    if (location == StandardLocation.CLASS_PATH) {
-      return classpath;
-    } else if (location == StandardLocation.SOURCE_PATH) {
-      return sourcepath;
-    } else if (location == StandardLocation.PLATFORM_CLASS_PATH) {
-      return bootclasspath;
-    }
-    return new HashSet<>();
-  }
-
-  private static Set<String> getPathSet(List<String> options, String optName) {
-    for (int i = 0; i < options.size(); i++) {
-      if (options.get(i).equals(optName)) {
-        if (i + 1 >= options.size()) {
-          throw new IllegalArgumentException("Malformed " + optName + " argument");
-        }
-        Set<String> paths = new HashSet<>();
-        Collections.addAll(paths, options.get(i + 1).split(":"));
-        return paths;
-      }
-    }
-    return new HashSet<>();
-  }
-
-  private static JavaDetails getDetails(CompilationUnit unit) {
-    for (Any details : unit.getDetailsList()) {
-      if (details.getTypeUrl().equals(JavaCompilationUnitExtractor.JAVA_DETAILS_URL)) {
-        try {
-          return JavaDetails.parseFrom(details.getValue());
-        } catch (InvalidProtocolBufferException ipbe) {
-          System.err.println(
-              "WARNING: "
-                  + "CompilationUnit contains JavaDetails that could not be parsed: "
-                  + ipbe);
-        }
-      }
-    }
-    return null;
-  }
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileStore.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileStore.java
deleted file mode 100644
index 841115fb0..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitBasedJavaFileStore.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import com.google.devtools.kythe.platform.shared.FileDataProvider;
-import com.google.devtools.kythe.proto.Analysis.CompilationUnit;
-import java.nio.charset.Charset;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import javax.tools.JavaFileObject.Kind;
-
-/** An implementation of {@link JavaFileStore} based on data from a {@link CompilationUnit}. */
-public class CompilationUnitBasedJavaFileStore implements JavaFileStore {
-  private final CompilationUnitFileTree fileTree;
-  private final FileDataProvider contentProvider;
-  private final Charset encoding;
-
-  public CompilationUnitBasedJavaFileStore(
-      CompilationUnit unit, FileDataProvider contentProvider, Charset encoding) {
-    this.contentProvider = contentProvider;
-    this.encoding = encoding;
-
-    fileTree = new CompilationUnitFileTree(unit.getRequiredInputList());
-  }
-
-  @Override
-  public CustomJavaFileObject findByPath(String path, Kind kind) {
-    String digest = fileTree.lookup(path);
-    if (digest != null) {
-      return new CustomJavaFileObject(contentProvider, path, digest, null, kind, encoding);
-    }
-    return null;
-  }
-
-  @Override
-  public CustomJavaFileObject find(String className, Kind kind, Set<String> pathPrefixes) {
-    Path file = Paths.get(className.replace('.', '/') + kind.extension);
-    String dirname = file.getParent() == null ? "." : file.getParent().toString();
-    String basename = file.getFileName().toString();
-    for (String prefix : pathPrefixes) {
-      String dirToLookIn = join(prefix, dirname);
-      String digest = fileTree.lookup(dirToLookIn, basename);
-      if (digest != null) {
-        return new CustomJavaFileObject(
-            contentProvider, join(prefix, file.toString()), digest, className, kind, encoding);
-      }
-    }
-    return null;
-  }
-
-  @Override
-  public CustomFileObject find(String packageName, String relativeName, Set<String> pathPrefixes) {
-    String packagePath = packageName.replace('.', '/');
-    for (String prefix : pathPrefixes) {
-      String dirToLookIn = Paths.get(prefix, packagePath).toString();
-      String digest = fileTree.lookup(dirToLookIn, relativeName);
-      if (digest != null) {
-        return new CustomFileObject(
-            contentProvider, join(prefix, packagePath, relativeName), digest, encoding);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * {@inheritDoc}
-   *
-   * <p>TODO: recurse option does not work yet. This method only returns the classes inside {@code
-   * packageName} and ignores the sub-packages.
-   */
-  @Override
-  public Set<CustomJavaFileObject> list(
-      String packageName, Set<Kind> kinds, Set<String> pathPrefixes, boolean recurse) {
-    Set<CustomJavaFileObject> matchingFiles = new HashSet<>();
-    if (pathPrefixes == null) {
-      return matchingFiles;
-    }
-    String packagePath = packageName.replace('.', '/');
-    for (String prefix : pathPrefixes) {
-      String dirToLookIn = join(prefix, packagePath);
-      Map<String, String> dir = fileTree.list(dirToLookIn);
-      if (dir != null) {
-        matchingFiles.addAll(getFiles(dirToLookIn, dir, kinds, packageName));
-      }
-    }
-    return matchingFiles;
-  }
-
-  /** Uses the map built from the required inputs to build a list of files per directory. */
-  private Set<CustomJavaFileObject> getFiles(
-      String dirToLookIn, Map<String, String> entries, Set<Kind> kinds, String packageName) {
-    Set<CustomJavaFileObject> files = new HashSet<>();
-    for (Map.Entry<String, String> entry : entries.entrySet()) {
-      String fileName = entry.getKey();
-      String digest = entry.getValue();
-      if (digest.equals(CompilationUnitFileTree.DIRECTORY_DIGEST)) {
-        // Don't include directories in the file listing.
-        continue;
-      }
-      for (Kind kind : kinds) {
-        if (fileName.endsWith(kind.extension)) {
-          int lastDot = fileName.lastIndexOf('.');
-          // files with kind == OTHER may not have an extension.
-          String simpleName = lastDot == -1 ? fileName : fileName.substring(0, lastDot);
-          String clsName = packageName + "." + simpleName;
-          files.add(
-              new CustomJavaFileObject(
-                  contentProvider, join(dirToLookIn, fileName), digest, clsName, kind, encoding));
-          break;
-        }
-      }
-    }
-    return files;
-  }
-
-  private static String join(String root, String... paths) {
-    return Paths.get(root, paths).toString();
-  }
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitPathFileManager.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitPathFileManager.java
index 5aaad89e6..8ea128596 100644
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitPathFileManager.java
+++ b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CompilationUnitPathFileManager.java
@@ -95,15 +95,13 @@ public final class CompilationUnitPathFileManager extends ForwardingStandardJava
     defaultPlatformClassPath =
         ImmutableSet.copyOf(
             Iterables.transform(
-                // TODO(shahms): use getLocationAsPaths on Java 9
-                fileManager.getLocation(StandardLocation.PLATFORM_CLASS_PATH),
-                f -> f.toPath().normalize().toString()));
+                fileManager.getLocationAsPaths(StandardLocation.PLATFORM_CLASS_PATH),
+                p -> p.normalize().toString()));
 
     readAheadProvider = new ReadAheadDataProvider(fileDataProvider);
     fileSystem = CompilationUnitFileSystem.create(compilationUnit, readAheadProvider);
     memFileSystem = Jimfs.newFileSystem(Configuration.unix());
-    // When compiled for Java 9+ this is ambiguous, so disambiguate to the compatibility shim.
-    setPathFactory((ForwardingStandardJavaFileManager.PathFactory) this::getPath);
+    setPathFactory(this::getPath);
     setLocations(
         findJavaDetails(compilationUnit)
             .map(details -> toLocationMap(details))
@@ -278,8 +276,7 @@ public final class CompilationUnitPathFileManager extends ForwardingStandardJava
     return Maps.filterValues(
         defaultLocationMapBuilder()
             .put(StandardLocation.CLASS_PATH, toPaths(details.getClasspathList()))
-            // TODO(shahms): Use StandardLocation.MODULE_PATH directly on JDK9+
-            .put(StandardLocation.locationFor("MODULE_PATH"), toPaths(details.getClasspathList()))
+            .put(StandardLocation.MODULE_PATH, toPaths(details.getClasspathList()))
             .put(StandardLocation.SOURCE_PATH, toPaths(details.getSourcepathList()))
             .put(
                 StandardLocation.PLATFORM_CLASS_PATH,
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomFileObject.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomFileObject.java
deleted file mode 100644
index 5cd4ef5b4..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomFileObject.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import com.google.devtools.kythe.platform.shared.FileDataProvider;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Objects;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import javax.tools.FileObject;
-
-/** File object backed by a {@link Future}. */
-@com.sun.tools.javac.api.ClientCodeWrapper.Trusted
-public class CustomFileObject implements FileObject {
-  protected final Path path;
-  protected final String digest;
-  protected final Future<byte[]> future;
-
-  protected final Charset encoding;
-
-  public CustomFileObject(
-      FileDataProvider contentProvider, String path, String digest, Charset encoding) {
-    this.path = Paths.get(path);
-    this.digest = digest;
-    this.encoding = encoding;
-
-    this.future = contentProvider.startLookup(path, digest);
-  }
-
-  @Override
-  public URI toUri() {
-    try {
-      return new URI("custom://" + digest + "/" + path);
-    } catch (URISyntaxException e) {
-      return null;
-    }
-  }
-
-  @Override
-  public String getName() {
-    return path.getFileName().toString();
-  }
-
-  @Override
-  public InputStream openInputStream() throws IOException {
-    return new ByteArrayInputStream(getData());
-  }
-
-  private byte[] getData() throws IOException {
-    try {
-      byte[] result = future.get();
-      if (result == null) {
-        throw new IOException(
-            String.format("Unable to find file with digest %s, path %s", digest, path));
-      }
-      return result;
-    } catch (InterruptedException | ExecutionException e) {
-      throw new IOException(e);
-    }
-  }
-
-  @Override
-  public OutputStream openOutputStream() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
-    return new InputStreamReader(openInputStream(), UTF_8);
-  }
-
-  @Override
-  public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
-    return new String(getData(), encoding);
-  }
-
-  @Override
-  public Writer openWriter() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public long getLastModified() {
-    return 0;
-  }
-
-  @Override
-  public boolean delete() {
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    return Objects.hashCode(digest);
-  }
-
-  @Override
-  public boolean equals(Object other) {
-    // This implementation relies on the Trusted annotation on this class to opt out of using the
-    // WrappedJavaFileObject wrapper class.
-    if (this == other) {
-      return true;
-    } else if (!(other instanceof CustomFileObject)) {
-      return false;
-    }
-    CustomFileObject oc = (CustomFileObject) other;
-    return Objects.equals(path, oc.path) && Objects.equals(digest, oc.digest);
-  }
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomJavaFileObject.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomJavaFileObject.java
deleted file mode 100644
index aa1597c46..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/CustomJavaFileObject.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import com.google.devtools.kythe.platform.shared.FileDataProvider;
-import java.nio.charset.Charset;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.NestingKind;
-import javax.tools.JavaFileObject;
-
-/** JavaFileObject that can be provided a body at a future time. */
-@com.sun.tools.javac.api.ClientCodeWrapper.Trusted
-public class CustomJavaFileObject extends CustomFileObject implements JavaFileObject {
-
-  private final String className;
-  private final Kind kind;
-
-  public CustomJavaFileObject(
-      FileDataProvider contentProvider,
-      String path,
-      String digest,
-      String className,
-      Kind kind,
-      Charset encoding) {
-    super(contentProvider, path, digest, encoding);
-    this.className = className;
-    this.kind = kind;
-  }
-
-  @Override
-  public Kind getKind() {
-    return kind;
-  }
-
-  @Override
-  public boolean isNameCompatible(String simpleName, Kind kind) {
-    return getName().equals(simpleName + kind.extension);
-  }
-
-  @Override
-  public NestingKind getNestingKind() {
-    return null;
-  }
-
-  @Override
-  public Modifier getAccessLevel() {
-    return null;
-  }
-
-  public String getClassName() {
-    return className;
-  }
-
-  @Override
-  public String toString() {
-    return "CustomJavaFileObject [className=" + className + ", kind=" + kind + "]";
-  }
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/ForwardingStandardJavaFileManager.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/ForwardingStandardJavaFileManager.java
index d5e65e548..f444ebd1e 100644
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/ForwardingStandardJavaFileManager.java
+++ b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/ForwardingStandardJavaFileManager.java
@@ -15,14 +15,8 @@
  */
 package com.google.devtools.kythe.platform.java.filemanager;
 
-import com.google.common.base.Throwables;
-import com.google.common.collect.Iterables;
-import com.google.common.flogger.FluentLogger;
-import com.google.common.reflect.Reflection;
 import java.io.File;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.nio.file.Path;
 import java.util.Collection;
 import java.util.ServiceLoader;
@@ -41,109 +35,41 @@ import javax.tools.StandardJavaFileManager;
 public class ForwardingStandardJavaFileManager
     extends ForwardingJavaFileManager<StandardJavaFileManager> implements StandardJavaFileManager {
 
-  private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-
-  // TODO(shahms): Remove these when we've moved to JDK9 and can invoke the methods directly.
-  //  Until then, cache the lookup of these extended StandardJavaFileManager methods.
-  private static final Method getLocationForModuleNameMethod =
-      getMethodOrNull("getLocationForModule", Location.class, String.class);
-  private static final Method getLocationForModuleFileMethod =
-      getMethodOrNull("getLocationForModule", Location.class, JavaFileObject.class);
-  private static final Method getServiceLoaderMethod =
-      getMethodOrNull("getServiceLoader", Location.class, Class.class);
-  private static final Method inferModuleNameMethod =
-      getMethodOrNull("inferModuleName", Location.class);
-  private static final Method listLocationsForModulesMethod =
-      getMethodOrNull("listLocationsForModules", Location.class);
-  private static final Method containsMethod =
-      getMethodOrNull("contains", Location.class, FileObject.class);
-  private static final Method getJavaFileObjectsFromPathsMethod =
-      getMethodOrNull("getJavaFileObjectsFromPaths", Iterable.class);
-  private static final Method getJavaFileObjectsMethod =
-      getMethodOrNull("getJavaFileObjects", Path[].class);
-  private static final Method setLocationFromPathsMethod =
-      getMethodOrNull("setLocationFromPaths", Location.class, Collection.class);
-  private static final Method setLocationForModuleMethod =
-      getMethodOrNull("setLocationForModule", Location.class, String.class, Collection.class);
-  private static final Method getLocationAsPathsMethod =
-      getMethodOrNull("getLocationAsPaths", Location.class);
-  private static final Method asPathMethod = getMethodOrNull("asPath", FileObject.class);
-  private static final Class<?> pathFactoryInterface = getClassOrNull("PathFactory");
-  private static final Method setPathFactoryMethod =
-      getMethodOrNull("setPathFactory", pathFactoryInterface);
-
-  /** Equivalent interface for JDK9's StandardJavaFileManager.PathFactory */
-  @FunctionalInterface
-  public static interface PathFactory {
-    Path getPath(String path, String... more);
-  }
-
   protected ForwardingStandardJavaFileManager(StandardJavaFileManager fileManager) {
     super(fileManager);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public Location getLocationForModule(Location location, String moduleName) throws IOException {
-    // TODO(shahms): return fileManager.getLocationForModule(location, fo);
-    try {
-      return (Location) getLocationForModuleNameMethod.invoke(fileManager, location, moduleName);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getLocationForModule", e, IOException.class);
-    }
+    return fileManager.getLocationForModule(location, moduleName);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public Location getLocationForModule(Location location, JavaFileObject fo) throws IOException {
-    // TODO(shahms): return fileManager.getLocationForModule(location, fo);
-    try {
-      return (Location) getLocationForModuleFileMethod.invoke(fileManager, location, fo);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getLocationForModule", e, IOException.class);
-    }
+    return fileManager.getLocationForModule(location, fo);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   @SuppressWarnings({"unchecked"}) // safe by specification.
   public <S> ServiceLoader<S> getServiceLoader(Location location, Class<S> service)
       throws IOException {
-    // TODO(shahms): return fileManager.getServiceLoader(location, service);
-    try {
-      return (ServiceLoader<S>) getServiceLoaderMethod.invoke(location, service);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getServiceLoader", e, IOException.class);
-    }
+    return fileManager.getServiceLoader(location, service);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public String inferModuleName(Location location) throws IOException {
-    // TODO(shahms): return fileManager.inferModuleName(location);
-    try {
-      return (String) inferModuleNameMethod.invoke(fileManager, location);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("inferModuleName", e, IOException.class);
-    }
+    return fileManager.inferModuleName(location);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   @SuppressWarnings({"unchecked"}) // safe by specification.
   public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
-    // TODO(shahms): return fileManager.listLocationsForModules(location);
-    try {
-      return (Iterable<Set<Location>>) listLocationsForModulesMethod.invoke(fileManager, location);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible(
-          "listLocationsForModules", e, IOException.class);
-    }
+    return fileManager.listLocationsForModules(location);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public boolean contains(Location location, FileObject fo) throws IOException {
-    // TODO(shahms): return fileManager.contains(location, fo);
-    try {
-      return (Boolean) containsMethod.invoke(fileManager, location, fo);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("contains", e, IOException.class);
-    }
+    return fileManager.contains(location, fo);
   }
 
   @Override
@@ -152,17 +78,11 @@ public class ForwardingStandardJavaFileManager
     return fileManager.getJavaFileObjectsFromFiles(files);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   @SuppressWarnings({"unchecked", "IterablePathParameter"}) // safe by specification.
   public Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(
       Iterable<? extends Path> paths) {
-    //  TODO(shahms): fileManager.getJavaFileObjectsFromPaths(paths);
-    try {
-      return (Iterable<? extends JavaFileObject>)
-          getJavaFileObjectsFromPathsMethod.invoke(fileManager, paths);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getJavaFileObjectsFromPaths", e);
-    }
+    return fileManager.getJavaFileObjectsFromPaths(paths);
   }
 
   @Override
@@ -180,38 +100,22 @@ public class ForwardingStandardJavaFileManager
     return fileManager.getJavaFileObjects(names);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   @SuppressWarnings({"unchecked"}) // safe by specification.
   public Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths) {
-    //  TODO(shahms): fileManager.getJavaFileObjects(paths);
-    try {
-      return (Iterable<? extends JavaFileObject>)
-          getJavaFileObjectsMethod.invoke(fileManager, (Object) paths);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getJavaFileObjects", e);
-    }
+    return fileManager.getJavaFileObjects(paths);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public void setLocationFromPaths(Location location, Collection<? extends Path> paths)
       throws IOException {
-    // TODO(shahms): fileManager.setLocationFromPaths(location, paths);
-    try {
-      setLocationFromPathsMethod.invoke(fileManager, location, paths);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("setLocationFromPaths", e, IOException.class);
-    }
+    fileManager.setLocationFromPaths(location, paths);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public void setLocationForModule(
       Location location, String moduleName, Collection<? extends Path> paths) throws IOException {
-    // TODO(shahms): fileManager.setLocationForModule(location, moduleName, paths);
-    try {
-      setLocationForModuleMethod.invoke(fileManager, location, moduleName, paths);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("setLocationForModule", e, IOException.class);
-    }
+    fileManager.setLocationForModule(location, moduleName, paths);
   }
 
   @Override
@@ -219,18 +123,10 @@ public class ForwardingStandardJavaFileManager
     return fileManager.getLocation(location);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   @SuppressWarnings({"unchecked"}) // Safe by specification.
   public Iterable<? extends Path> getLocationAsPaths(Location location) {
-    // TODO(shahms): return fileManager.getLocationAsPaths(location);
-    try {
-      return (Iterable<? extends Path>) getLocationAsPathsMethod.invoke(fileManager, location);
-    } catch (NullPointerException npe) {
-      // Fall back to using getLocation from the underlying fileManager.
-      return Iterables.transform(fileManager.getLocation(location), File::toPath);
-    } catch (ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("getLocationAsPaths", e);
-    }
+    return fileManager.getLocationAsPaths(location);
   }
 
   @Override
@@ -243,82 +139,13 @@ public class ForwardingStandardJavaFileManager
     fileManager.setLocation(location, files);
   }
 
-  // TODO(shahms): @Override; added in JDK9
+  @Override
   public Path asPath(FileObject fo) {
-    // TODO(shahms): return fileManager.asPath(fo);
-    try {
-      return (Path) asPathMethod.invoke(fileManager, fo);
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("asPath", e);
-    }
-  }
-
-  // TODO(shahms): @Override; added in JDK9
-  // We've intentionally mirrored this functional interface
-  // as this is a compatibility shim which will be deleted when
-  // we can stop requiring that this be buildable on Java 8 but run
-  // on JDK11.
-  @SuppressWarnings("FunctionalInterfaceClash")
-  public void setPathFactory(PathFactory factory) {
-    // TODO(shahms): fileManager.setPathFactory(factory);
-    try {
-      setPathFactoryMethod.invoke(
-          fileManager,
-          Reflection.newProxy(
-              pathFactoryInterface,
-              (proxy, method, args) -> {
-                return factory.getPath((String) args[0], (String[]) args[1]);
-              }));
-    } catch (NullPointerException | ReflectiveOperationException e) {
-      throw propagateInvocationTargetErrorIfPossible("setPathFactory", e);
-    }
+    return fileManager.asPath(fo);
   }
 
-  private static Method getMethodOrNull(String name, Class<?>... parameterTypes) {
-    try {
-      return StandardJavaFileManager.class.getMethod(name, parameterTypes);
-    } catch (NoSuchMethodException e) {
-      logger.atInfo().withCause(e).log("Failed to find extended StandardJavaFileManager method");
-    }
-    return null;
-  }
-
-  private static Class<?> getClassOrNull(String name) {
-    try {
-      return Class.forName(
-          StandardJavaFileManager.class.getCanonicalName() + "$" + name,
-          true,
-          StandardJavaFileManager.class.getClassLoader());
-    } catch (ClassNotFoundException e) {
-      logger.atInfo().withCause(e).log("Failed to find StandardJavaFileManager class");
-    }
-    return null;
-  }
-
-  private static UnsupportedOperationException propagateInvocationTargetErrorIfPossible(
-      String methodName, Throwable error) {
-    if (error instanceof InvocationTargetException) {
-      Throwables.throwIfUnchecked(((InvocationTargetException) error).getCause());
-    }
-    return unsupportedVersionError(methodName, error);
-  }
-
-  private static UnsupportedOperationException propagateInvocationTargetErrorIfPossible(
-      String methodName, Throwable error, Class<IOException> declaredType) throws IOException {
-    if (error instanceof InvocationTargetException) {
-      // Log the exception because the propagated destination may not provide a nice error log.
-      Throwable t = ((InvocationTargetException) error).getCause();
-      logger.atWarning().withCause(t).log(
-          "Error in underlying filemanager. A more detailed message may have been output to"
-              + " stderr.");
-      Throwables.propagateIfPossible(t, declaredType);
-    }
-    return unsupportedVersionError(methodName, error);
-  }
-
-  private static UnsupportedOperationException unsupportedVersionError(
-      String methodName, Throwable cause) {
-    return new UnsupportedOperationException(
-        methodName + " called by unsupported Java version", cause);
+  @Override
+  public void setPathFactory(StandardJavaFileManager.PathFactory factory) {
+    fileManager.setPathFactory(factory);
   }
 }
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStore.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStore.java
deleted file mode 100644
index d0c54f2f6..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStore.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import java.util.Set;
-import javax.tools.JavaFileObject.Kind;
-import org.checkerframework.checker.nullness.qual.Nullable;
-
-/**
- * JavaFileStore is a service for finding Java compiler related files such as {@code .class} or
- * {@code .java}, or potentially any file that can be consumed by Java compiler. It is up to the
- * implementors of this interface to define what is backing their store. The store can be supplied
- * by a single jar file, multiple jar files, a database table, a directory on disk or any
- * combination of these.
- *
- * <p>File store is not tied to a specific Java path location. Meaning a store can be used for class
- * or source retrieval. Users of this service can differentiate between the two using a path prefix.
- */
-public interface JavaFileStore {
-
-  /**
-   * Finds and returns the Java file object associated with the {@code className} and {@code kind}.
-   * {@code pathPrefixes} are used to limit possible search paths. There is no limitation on the
-   * format of a path. It is up to implementation to decide what it should be.
-   */
-  @Nullable
-  public CustomJavaFileObject find(String className, Kind kind, Set<String> pathPrefixes);
-
-  /**
-   * Finds and returns the file object in a package, {@code packageName}, with name {@code
-   * relativeName}. {@code pathPrefixes} are used to limit possible search paths. There is no
-   * limitation on the format of a path. It is up to implementation to decide what it should be.
-   */
-  @Nullable
-  public CustomFileObject find(String packageName, String relativeName, Set<String> pathPrefixes);
-
-  /**
-   * Finds and returns the Java file object with the exact path matching {@code path} and {@code
-   * kind}. There is no limitation on the format of a path. It is up to implementation to decide
-   * what it should be.
-   */
-  @Nullable
-  public CustomJavaFileObject findByPath(String path, Kind kind);
-
-  /**
-   * Finds and returns all the Java file objects in a package, {@code packageName}. {@code
-   * pathPrefixes} are used to limit possible search paths. There is no limitation on the format of
-   * a path. It is up to implementation to decide what it should be.
-   */
-  public Set<CustomJavaFileObject> list(
-      String packageName, Set<Kind> kinds, Set<String> pathPrefixes, boolean recurse);
-}
diff --git a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStoreBasedFileManager.java b/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStoreBasedFileManager.java
deleted file mode 100644
index d68a7272f..000000000
--- a/kythe/java/com/google/devtools/kythe/platform/java/filemanager/JavaFileStoreBasedFileManager.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright 2014 The Kythe Authors. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.devtools.kythe.platform.java.filemanager;
-
-import com.google.common.collect.Iterables;
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import javax.tools.FileObject;
-import javax.tools.JavaFileObject;
-import javax.tools.JavaFileObject.Kind;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.StandardLocation;
-
-/** {@link StandardJavaFileManager} backed by a {@link JavaFileStore}. */
-@com.sun.tools.javac.api.ClientCodeWrapper.Trusted
-public class JavaFileStoreBasedFileManager extends ForwardingStandardJavaFileManager {
-
-  protected JavaFileStore javaFileStore;
-
-  public JavaFileStoreBasedFileManager(
-      JavaFileStore javaFileStore, StandardJavaFileManager fileManager) {
-    super(fileManager);
-    this.javaFileStore = javaFileStore;
-  }
-
-  protected Set<String> getSearchPaths(Location location) {
-    Set<String> dirsToLookIn = new HashSet<>();
-    Iterable<? extends File> paths = getLocation(location);
-    if (paths != null) {
-      for (File dir : paths) {
-        dirsToLookIn.add(dir.getPath());
-      }
-    }
-    return dirsToLookIn;
-  }
-
-  /**
-   * Lists all files in a package, tries to find files known to this manager before directing to the
-   * underlying filemanager.
-   */
-  @Override
-  public Iterable<JavaFileObject> list(
-      Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
-    Set<String> dirsToLookIn = getSearchPaths(location);
-    Set<CustomJavaFileObject> matchingFiles =
-        javaFileStore.list(packageName, kinds, dirsToLookIn, recurse);
-    // Prefer source over class file if the source exists in the source path:
-    if (location == StandardLocation.CLASS_PATH && kinds.contains(Kind.CLASS)) {
-      Map<String, CustomJavaFileObject> classNameToFile = new HashMap<>();
-      for (CustomJavaFileObject fileObject : matchingFiles) {
-        classNameToFile.put(fileObject.getClassName(), fileObject);
-      }
-      Set<Kind> sourceKinds = new HashSet<>();
-      sourceKinds.add(Kind.SOURCE);
-      Set<CustomJavaFileObject> matchedSources =
-          javaFileStore.list(
-              packageName, sourceKinds, getSearchPaths(StandardLocation.SOURCE_PATH), recurse);
-      for (CustomJavaFileObject source : matchedSources) {
-        if (classNameToFile.containsKey(source.getClassName())) {
-          classNameToFile.put(source.getClassName(), source);
-        }
-      }
-      matchingFiles.clear();
-      matchingFiles.addAll(classNameToFile.values());
-    }
-
-    // TODO(schroederc): handle case where some of the package is in the JavaFileStore, but not all
-    if (!matchingFiles.isEmpty()) {
-      return new ArrayList<>(matchingFiles);
-    }
-
-    List<JavaFileObject> matchedFiles = new ArrayList<>();
-    matchedFiles.addAll(matchingFiles);
-
-    if (location == StandardLocation.SOURCE_PATH) {
-      // XXX(#818): do not search the underlying file manager (and the local fs) for source files
-      return matchedFiles;
-    }
-
-    // Ask underlying file manager for its knowledge of files, e.g.
-    // in case of JRE we use the files locally known to the compiler.
-    for (JavaFileObject jfo : super.list(location, packageName, kinds, recurse)) {
-      matchedFiles.add(jfo);
-    }
-    return matchedFiles;
-  }
-
-  private JavaFileObject getJavaFileForInputFromCustomLocation(
-      final Location location, final String className, final Kind kind) {
-    return javaFileStore.find(className, kind, getSearchPaths(location));
-  }
-
-  /**
-   * Gets file for classname, from local filemanager before directing to the underlying filemanager.
-   */
-  @Override
-  public JavaFileObject getJavaFileForInput(
-      final Location location, final String className, final Kind kind) throws IOException {
-    JavaFileObject customJavaFile =
-        getJavaFileForInputFromCustomLocation(location, className, kind);
-    if (customJavaFile != null) {
-      return customJavaFile;
-    }
-    return super.getJavaFileForInput(location, className, kind);
-  }
-
-  @Override
-  public String inferBinaryName(Location location, JavaFileObject file) {
-    if (file instanceof CustomJavaFileObject) {
-      CustomJavaFileObject cjfo = (CustomJavaFileObject) file;
-      return cjfo.getClassName();
-    }
-    return super.inferBinaryName(location, file);
-  }
-
-  public JavaFileObject getJavaFileFromPath(String file, Kind kind) {
-    return javaFileStore.findByPath(file, kind);
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjectsFromFiles(
-      Iterable<? extends File> files) {
-    List<JavaFileObject> javaFileObjects = new ArrayList<>();
-    for (File file : files) {
-      String path = file.getPath();
-      JavaFileObject.Kind kind = getKind(path);
-      JavaFileObject jfo = getJavaFileFromPath(path, kind);
-      javaFileObjects.add(jfo);
-    }
-    return javaFileObjects;
-  }
-
-  @Override
-  public FileObject getFileForInput(Location location, String packageName, String relativeName)
-      throws IOException {
-    FileObject fileObject = javaFileStore.find(packageName, relativeName, getSearchPaths(location));
-    if (fileObject == null) {
-      fileObject = super.getFileForInput(location, packageName, relativeName);
-    }
-    return fileObject;
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjectsFromStrings(Iterable<String> names) {
-    return getJavaFileObjectsFromFiles(Iterables.transform(names, File::new));
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjectsFromPaths(
-      @SuppressWarnings("IterablePathParameter") Iterable<? extends Path> paths) {
-    return getJavaFileObjectsFromFiles(Iterables.transform(paths, Path::toFile));
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjects(String... names) {
-    return getJavaFileObjectsFromStrings(Arrays.asList(names));
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjects(File... files) {
-    return getJavaFileObjectsFromFiles(Arrays.asList(files));
-  }
-
-  @Override
-  public Iterable<? extends JavaFileObject> getJavaFileObjects(Path... paths) {
-    return getJavaFileObjectsFromPaths(Arrays.asList(paths));
-  }
-
-  @Override
-  public boolean contains(Location location, FileObject file) throws IOException {
-    if (file instanceof CustomFileObject) {
-      // The URI paths for custom file objects will always include an
-      // extra leading '/'.
-      String filePath = file.toUri().getPath().substring(1);
-      // Do a trivial prefix-search based on the search paths for the given location.
-      Set<String> paths = getSearchPaths(location);
-      for (String path : paths) {
-        if (filePath.startsWith(path)) {
-          return true;
-        }
-      }
-      return false;
-    }
-    return super.contains(location, file);
-  }
-
-  @Override
-  public Path asPath(FileObject file) {
-    if (file instanceof CustomFileObject) {
-      return ((CustomFileObject) file).path;
-    }
-    return super.asPath(file);
-  }
-
-  public static Kind getKind(String name) {
-    if (name.endsWith(Kind.CLASS.extension)) {
-      return Kind.CLASS;
-    } else if (name.endsWith(Kind.SOURCE.extension)) {
-      return Kind.SOURCE;
-    } else if (name.endsWith(Kind.HTML.extension)) {
-      return Kind.HTML;
-    } else {
-      return Kind.OTHER;
-    }
-  }
-
-  @Override
-  public boolean isSameFile(FileObject a, FileObject b) {
-    if (a instanceof CustomFileObject) {
-      return a.equals(b);
-    } else if (b instanceof CustomFileObject) {
-      return b.equals(a);
-    }
-    return super.isSameFile(a, b);
-  }
-}
diff --git a/third_party/BUILD b/third_party/BUILD
index 30bf9846e..dd543e520 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -17,7 +17,6 @@ filegroup(
         "//third_party/glog:COPYING",
         "//third_party/go:licenses",
         "//third_party/guava:COPYING",
-        "//third_party/javac:license",
         "//third_party/jcommander:license.txt",
         "//third_party/jsr250_api:LICENSE",
         "//third_party/jsr305:LICENSE",
diff --git a/third_party/javac/BUILD b/third_party/javac/BUILD
deleted file mode 100644
index 85c2ba4d4..000000000
--- a/third_party/javac/BUILD
+++ /dev/null
@@ -1,29 +0,0 @@
-load("@rules_java//java:defs.bzl", "java_import")
-
-package(default_visibility = ["//visibility:public"])
-
-licenses(["restricted"])  # GNU GPL v2 with Classpath exception
-
-filegroup(
-    name = "license",
-    srcs = ["LICENSE"],
-)
-
-java_import(
-    name = "javac9",
-    jars = [
-        ":jdk_compiler_jar",
-        ":java_compiler_jar",
-    ],
-    neverlink = True,
-)
-
-filegroup(
-    name = "jdk_compiler_jar",
-    srcs = ["jdk_compiler.jar"],
-)
-
-filegroup(
-    name = "java_compiler_jar",
-    srcs = ["java_compiler.jar"],
-)
diff --git a/third_party/javac/LICENSE b/third_party/javac/LICENSE
deleted file mode 100644
index 8b400c7ab..000000000
--- a/third_party/javac/LICENSE
+++ /dev/null
@@ -1,347 +0,0 @@
-The GNU General Public License (GPL)
-
-Version 2, June 1991
-
-Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Everyone is permitted to copy and distribute verbatim copies of this license
-document, but changing it is not allowed.
-
-Preamble
-
-The licenses for most software are designed to take away your freedom to share
-and change it.  By contrast, the GNU General Public License is intended to
-guarantee your freedom to share and change free software--to make sure the
-software is free for all its users.  This General Public License applies to
-most of the Free Software Foundation's software and to any other program whose
-authors commit to using it.  (Some other Free Software Foundation software is
-covered by the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.  Our
-General Public Licenses are designed to make sure that you have the freedom to
-distribute copies of free software (and charge for this service if you wish),
-that you receive source code or can get it if you want it, that you can change
-the software or use pieces of it in new free programs; and that you know you
-can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone to deny
-you these rights or to ask you to surrender the rights.  These restrictions
-translate to certain responsibilities for you if you distribute copies of the
-software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis or for
-a fee, you must give the recipients all the rights that you have.  You must
-make sure that they, too, receive or can get the source code.  And you must
-show them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and (2)
-offer you this license which gives you legal permission to copy, distribute
-and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain that
-everyone understands that there is no warranty for this free software.  If the
-software is modified by someone else and passed on, we want its recipients to
-know that what they have is not the original, so that any problems introduced
-by others will not reflect on the original authors' reputations.
-
-Finally, any free program is threatened constantly by software patents.  We
-wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program proprietary.
-To prevent this, we have made it clear that any patent must be licensed for
-everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and modification
-follow.
-
-TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-0. This License applies to any program or other work which contains a notice
-placed by the copyright holder saying it may be distributed under the terms of
-this General Public License.  The "Program", below, refers to any such program
-or work, and a "work based on the Program" means either the Program or any
-derivative work under copyright law: that is to say, a work containing the
-Program or a portion of it, either verbatim or with modifications and/or
-translated into another language.  (Hereinafter, translation is included
-without limitation in the term "modification".) Each licensee is addressed as
-"you".
-
-Activities other than copying, distribution and modification are not covered by
-this License; they are outside its scope.  The act of running the Program is
-not restricted, and the output from the Program is covered only if its contents
-constitute a work based on the Program (independent of having been made by
-running the Program).  Whether that is true depends on what the Program does.
-
-1. You may copy and distribute verbatim copies of the Program's source code as
-you receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice and
-disclaimer of warranty; keep intact all the notices that refer to this License
-and to the absence of any warranty; and give any other recipients of the
-Program a copy of this License along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and you may
-at your option offer warranty protection in exchange for a fee.
-
-2. You may modify your copy or copies of the Program or any portion of it, thus
-forming a work based on the Program, and copy and distribute such modifications
-or work under the terms of Section 1 above, provided that you also meet all of
-these conditions:
-
-    a) You must cause the modified files to carry prominent notices stating
-    that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in whole or
-    in part contains or is derived from the Program or any part thereof, to be
-    licensed as a whole at no charge to all third parties under the terms of
-    this License.
-
-    c) If the modified program normally reads commands interactively when run,
-    you must cause it, when started running for such interactive use in the
-    most ordinary way, to print or display an announcement including an
-    appropriate copyright notice and a notice that there is no warranty (or
-    else, saying that you provide a warranty) and that users may redistribute
-    the program under these conditions, and telling the user how to view a copy
-    of this License.  (Exception: if the Program itself is interactive but does
-    not normally print such an announcement, your work based on the Program is
-    not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If identifiable
-sections of that work are not derived from the Program, and can be reasonably
-considered independent and separate works in themselves, then this License, and
-its terms, do not apply to those sections when you distribute them as separate
-works.  But when you distribute the same sections as part of a whole which is a
-work based on the Program, the distribution of the whole must be on the terms
-of this License, whose permissions for other licensees extend to the entire
-whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest your
-rights to work written entirely by you; rather, the intent is to exercise the
-right to control the distribution of derivative or collective works based on
-the Program.
-
-In addition, mere aggregation of another work not based on the Program with the
-Program (or with a work based on the Program) on a volume of a storage or
-distribution medium does not bring the other work under the scope of this
-License.
-
-3. You may copy and distribute the Program (or a work based on it, under
-Section 2) in object code or executable form under the terms of Sections 1 and
-2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable source
-    code, which must be distributed under the terms of Sections 1 and 2 above
-    on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three years, to
-    give any third party, for a charge no more than your cost of physically
-    performing source distribution, a complete machine-readable copy of the
-    corresponding source code, to be distributed under the terms of Sections 1
-    and 2 above on a medium customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer to
-    distribute corresponding source code.  (This alternative is allowed only
-    for noncommercial distribution and only if you received the program in
-    object code or executable form with such an offer, in accord with
-    Subsection b above.)
-
-The source code for a work means the preferred form of the work for making
-modifications to it.  For an executable work, complete source code means all
-the source code for all modules it contains, plus any associated interface
-definition files, plus the scripts used to control compilation and installation
-of the executable.  However, as a special exception, the source code
-distributed need not include anything that is normally distributed (in either
-source or binary form) with the major components (compiler, kernel, and so on)
-of the operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the source
-code from the same place counts as distribution of the source code, even though
-third parties are not compelled to copy the source along with the object code.
-
-4. You may not copy, modify, sublicense, or distribute the Program except as
-expressly provided under this License.  Any attempt otherwise to copy, modify,
-sublicense or distribute the Program is void, and will automatically terminate
-your rights under this License.  However, parties who have received copies, or
-rights, from you under this License will not have their licenses terminated so
-long as such parties remain in full compliance.
-
-5. You are not required to accept this License, since you have not signed it.
-However, nothing else grants you permission to modify or distribute the Program
-or its derivative works.  These actions are prohibited by law if you do not
-accept this License.  Therefore, by modifying or distributing the Program (or
-any work based on the Program), you indicate your acceptance of this License to
-do so, and all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-6. Each time you redistribute the Program (or any work based on the Program),
-the recipient automatically receives a license from the original licensor to
-copy, distribute or modify the Program subject to these terms and conditions.
-You may not impose any further restrictions on the recipients' exercise of the
-rights granted herein.  You are not responsible for enforcing compliance by
-third parties to this License.
-
-7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues), conditions
-are imposed on you (whether by court order, agreement or otherwise) that
-contradict the conditions of this License, they do not excuse you from the
-conditions of this License.  If you cannot distribute so as to satisfy
-simultaneously your obligations under this License and any other pertinent
-obligations, then as a consequence you may not distribute the Program at all.
-For example, if a patent license would not permit royalty-free redistribution
-of the Program by all those who receive copies directly or indirectly through
-you, then the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply and
-the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any patents or
-other property right claims or to contest validity of any such claims; this
-section has the sole purpose of protecting the integrity of the free software
-distribution system, which is implemented by public license practices.  Many
-people have made generous contributions to the wide range of software
-distributed through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing to
-distribute software through any other system and a licensee cannot impose that
-choice.
-
-This section is intended to make thoroughly clear what is believed to be a
-consequence of the rest of this License.
-
-8. If the distribution and/or use of the Program is restricted in certain
-countries either by patents or by copyrighted interfaces, the original
-copyright holder who places the Program under this License may add an explicit
-geographical distribution limitation excluding those countries, so that
-distribution is permitted only in or among countries not thus excluded.  In
-such case, this License incorporates the limitation as if written in the body
-of this License.
-
-9. The Free Software Foundation may publish revised and/or new versions of the
-General Public License from time to time.  Such new versions will be similar in
-spirit to the present version, but may differ in detail to address new problems
-or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any later
-version", you have the option of following the terms and conditions either of
-that version or of any later version published by the Free Software Foundation.
-If the Program does not specify a version number of this License, you may
-choose any version ever published by the Free Software Foundation.
-
-10. If you wish to incorporate parts of the Program into other free programs
-whose distribution conditions are different, write to the author to ask for
-permission.  For software which is copyrighted by the Free Software Foundation,
-write to the Free Software Foundation; we sometimes make exceptions for this.
-Our decision will be guided by the two goals of preserving the free status of
-all derivatives of our free software and of promoting the sharing and reuse of
-software generally.
-
-NO WARRANTY
-
-11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
-THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
-STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
-PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
-PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
-YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
-ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
-INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
-BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
-OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible
-use to the public, the best way to achieve this is to make it free software
-which everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program.  It is safest to attach
-them to the start of each source file to most effectively convey the exclusion
-of warranty; and each file should have at least the "copyright" line and a
-pointer to where the full notice is found.
-
-    One line to give the program's name and a brief idea of what it does.
-
-    Copyright (C) <year> <name of author>
-
-    This program is free software; you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by the Free
-    Software Foundation; either version 2 of the License, or (at your option)
-    any later version.
-
-    This program is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-    more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this when it
-starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
-    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
-    software, and you are welcome to redistribute it under certain conditions;
-    type 'show c' for details.
-
-The hypothetical commands 'show w' and 'show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may be
-called something other than 'show w' and 'show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
-is a sample; alter the names:
-
-    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-    'Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-    signature of Ty Coon, 1 April 1989
-
-    Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General Public
-License instead of this License.
-
-
-"CLASSPATH" EXCEPTION TO THE GPL
-
-Certain source files distributed by Oracle America and/or its affiliates are
-subject to the following clarification and special exception to the GPL, but
-only where Oracle has expressly included in the particular source file's header
-the words "Oracle designates this particular file as subject to the "Classpath"
-exception as provided by Oracle in the LICENSE file that accompanied this code."
-
-    Linking this library statically or dynamically with other modules is making
-    a combined work based on this library.  Thus, the terms and conditions of
-    the GNU General Public License cover the whole combination.
-
-    As a special exception, the copyright holders of this library give you
-    permission to link this library with independent modules to produce an
-    executable, regardless of the license terms of these independent modules,
-    and to copy and distribute the resulting executable under terms of your
-    choice, provided that you also meet, for each linked independent module,
-    the terms and conditions of the license of that module.  An independent
-    module is a module which is not derived from or based on this library.  If
-    you modify this library, you may extend this exception to your version of
-    the library, but you are not obligated to do so.  If you do not wish to do
-    so, delete this exception statement from your version.
diff --git a/third_party/javac/README.google b/third_party/javac/README.google
deleted file mode 100644
index 47ecaf9d2..000000000
--- a/third_party/javac/README.google
+++ /dev/null
@@ -1,7 +0,0 @@
-URL: http://repo1.maven.org/maven2/com/google/errorprone/javac/9-dev-r4023-1/javac-9+181-dev-r4173-1.jar
-Version: 9-dev-r4023-1
-License: GNU GPL v2 with Classpath exception
-License File: LICENSE
-Description: The OpenJDK javac.
-Local Modifications:
- No modifications.


Test patch:
diff --git a/kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg/BUILD b/kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg/BUILD
index 0c071e7b1..e2e06edfb 100644
--- a/kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg/BUILD
+++ b/kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg/BUILD
@@ -420,7 +420,6 @@ java_verifier_test(
     name = "diamond_operator_test",
     size = "small",
     srcs = ["DiamondOperations.java"],
-    extractor = "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac9_extractor",
     extractor_opts = [
         "-source",
         "9",
@@ -433,7 +432,6 @@ java_verifier_test(
     name = "local_inference_test",
     size = "small",
     srcs = ["LocalInference.java"],
-    extractor = "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac9_extractor",
     extractor_opts = [
         "-source",
         "11",
@@ -448,7 +446,6 @@ java_verifier_test(
     name = "private_interface_methods_test",
     size = "small",
     srcs = ["PrivateInterfaceMethods.java"],
-    extractor = "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac9_extractor",
     extractor_opts = [
         "-source",
         "9",
@@ -464,7 +461,6 @@ java_verifier_test(
         "Classes.java",
         "Definitions.java",
     ],
-    extractor = "//kythe/java/com/google/devtools/kythe/extractors/java/standalone:javac9_extractor",
 )
 
 # Duplicate a few tests to extract/verifier native Bazel Java compilation targets
diff --git a/kythe/javatests/com/google/devtools/kythe/platform/java/filemanager/BUILD b/kythe/javatests/com/google/devtools/kythe/platform/java/filemanager/BUILD
index c4c369fc8..818fc1c2f 100644
--- a/kythe/javatests/com/google/devtools/kythe/platform/java/filemanager/BUILD
+++ b/kythe/javatests/com/google/devtools/kythe/platform/java/filemanager/BUILD
@@ -8,7 +8,6 @@ java_test(
     srcs = ["CompilationUnitFileTreeTest.java"],
     test_class = "com.google.devtools.kythe.platform.java.filemanager.CompilationUnitFileTreeTest",
     deps = [
-        "//kythe/java/com/google/devtools/kythe/platform/java/filemanager",
         "//kythe/java/com/google/devtools/kythe/platform/java/filemanager:filetree",
         "//kythe/proto:analysis_java_proto",
         "//third_party/guava",