FastBuild: Remove now unnecessary reflection code
All current IDE versions the plugin is compatible with run on Java 11. As there's no need anymore to keep this code compatible with Java 8, remove the reflection code with a direct call.
@@ -200,19 +200,10 @@ final class FastBuildCompilerFactoryImpl implements FastBuildCompilerFactory {
for (int i = 0; i < jars.size(); ++i) {
urls[i] = jars.get(i).toURI().toURL();
}
- URLClassLoader urlClassLoader = new URLClassLoader(urls, platformClassLoader());
+ URLClassLoader urlClassLoader = new URLClassLoader(urls, ClassLoader.getPlatformClassLoader());
return urlClassLoader.loadClass(javaCompilerClass);
}
- private static ClassLoader platformClassLoader() {
- try {
- return (ClassLoader) ClassLoader.class.getMethod("getPlatformClassLoader").invoke(null);
- } catch (ReflectiveOperationException e) {
- // Java 8
- return null;
- }
- }
-
private static class JavacRunner implements FastBuildCompiler {
private final Javac javac;
