Package org.openrewrite.java
Class JavaUnrestrictedClassLoader
java.lang.Object
java.lang.ClassLoader
org.openrewrite.java.JavaUnrestrictedClassLoader
Rewrite's JavaParser is reliant on java's compiler internal classes that are now encapsulated within Java's
module system. Starting in Java 17, the JVM now enforces strong encapsulation of these internal classes and
default behavior is to throw a security exception when attempting to use these internal classes. This classloader
circumvents these security restrictions by isolating Rewrite's Java 17 parser implementation classes and then
loading any of the internal classes directly from the .jmod files.
NOTE: Any classes in the package "org.openrewrite.java.isolated" will be loaded into this isolated classloader.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
JavaUnrestrictedClassLoader
-
-
Method Details
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResource
in classClassLoader
-