Class PMDASMClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- net.sourceforge.pmd.lang.java.typeresolution.PMDASMClassLoader
-
- All Implemented Interfaces:
net.sourceforge.pmd.lang.java.typeresolution.internal.NullableClassLoader
@InternalApi @Deprecated public final class PMDASMClassLoader extends ClassLoader implements net.sourceforge.pmd.lang.java.typeresolution.internal.NullableClassLoader
Deprecated.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
couldResolve(String name)
Deprecated.Checks if the class loader could resolve a given class name (ie: it doesn't know for sure it will fail).Map<String,String>
getImportedClasses(String name)
Deprecated.static PMDASMClassLoader
getInstance(ClassLoader parent)
Deprecated.A new PMDASMClassLoader is created for each compilation unit, this method allows to reuse the same PMDASMClassLoader across all the compilation units.Class<?>
loadClass(String name)
Deprecated.Class<?>
loadClassOrNull(String name)
Deprecated.Not throwing CNFEs to represent failure makes a huge performance difference.-
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, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Method Detail
-
getInstance
public static PMDASMClassLoader getInstance(ClassLoader parent)
Deprecated.A new PMDASMClassLoader is created for each compilation unit, this method allows to reuse the same PMDASMClassLoader across all the compilation units.
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
Deprecated.- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
loadClassOrNull
public Class<?> loadClassOrNull(String name)
Deprecated.Not throwing CNFEs to represent failure makes a huge performance difference. Typeres as a whole is 2x faster.- Specified by:
loadClassOrNull
in interfacenet.sourceforge.pmd.lang.java.typeresolution.internal.NullableClassLoader
-
couldResolve
public boolean couldResolve(String name)
Deprecated.Checks if the class loader could resolve a given class name (ie: it doesn't know for sure it will fail). Notice, that the ability to resolve a class does not imply that the class will actually be found and resolved.- Parameters:
name
- the name of the class- Returns:
- whether the class can be resolved
-
getImportedClasses
public Map<String,String> getImportedClasses(String name) throws ClassNotFoundException
Deprecated.- Throws:
ClassNotFoundException
-
-