diff options
author | Liam Miller-Cushon <cushon@google.com> | 2022-02-01 10:32:30 -0800 |
---|---|---|
committer | Javac Team <javac-team+copybara@google.com> | 2022-02-01 10:33:26 -0800 |
commit | 3fb381b95a976f2e9b255cad641a5627cde711fd (patch) | |
tree | dc0ead5acf7ad3e5950ffe9ca909aa9dbd2b2d22 | |
parent | 8efebf1e4b4a455965a16cc16767df914c336f0d (diff) | |
download | turbine-3fb381b95a976f2e9b255cad641a5627cde711fd.tar.gz |
Remove reflective workaround for accessing `ClassLoader.getPlatformClassLoader`
PiperOrigin-RevId: 425660155
-rw-r--r-- | java/com/google/turbine/binder/Processing.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/java/com/google/turbine/binder/Processing.java b/java/com/google/turbine/binder/Processing.java index a836fa7..616bf2c 100644 --- a/java/com/google/turbine/binder/Processing.java +++ b/java/com/google/turbine/binder/Processing.java @@ -424,7 +424,7 @@ public class Processing { } return new URLClassLoader( toUrls(processorPath), - new ClassLoader(getPlatformClassLoader()) { + new ClassLoader(ClassLoader.getPlatformClassLoader()) { @Override protected Class<?> findClass(String name) throws ClassNotFoundException { if (name.equals("com.google.turbine.processing.TurbineProcessingEnvironment")) { @@ -457,15 +457,6 @@ public class Processing { return urls; } - public static @Nullable ClassLoader getPlatformClassLoader() { - try { - return (ClassLoader) ClassLoader.class.getMethod("getPlatformClassLoader").invoke(null); - } catch (ReflectiveOperationException e) { - // In earlier releases, set 'null' as the parent to delegate to the boot class loader. - return null; - } - } - private static ImmutableMap<String, String> processorOptions(ImmutableList<String> javacopts) { Map<String, String> result = new LinkedHashMap<>(); // ImmutableMap.Builder rejects duplicates for (String javacopt : javacopts) { |