Class ChicoryPremain.ChicoryLoader
- Object
-
- ClassLoader
-
- ChicoryLoader
-
- Enclosing class:
- ChicoryPremain
public static class ChicoryPremain.ChicoryLoader extends ClassLoader
Classloader for the BCEL code. Using this classloader guarantees that we get the correct version of BCEL and not a possible incompatible version from elsewhere on the user's classpath. We also load daikon.chicory.Instrument via this (since that class is the user of all of the BCEL classes). All references to BCEL must be within that class (so that all references to BCEL will get resolved by this classloader).There are several versions of BCEL that have been released:
- the original 5.2 version
- an interim 6.0 version
- the offical 6.0 release version
- the offical 6.1 release version
- the PLSE 6.1 release version (includes LocalVariableGen fix)
- the offical 6.2 release version (includes LocalVariableGen fix)
- the offical 6.3 release version
- the offical 6.3.1 release version
- the offical 6.4.1 release version
- the PLSE 6.4.1.1 release version (includes JDK 11 support)
Note that both Chicory and DynComp use the ChicoryLoader to load BCEL and to verify that the version loaded is acceptable. However, the official 6.1 release version is sufficient for Chicory while DynComp requires the latest PLSE 6.4.1.1 version. Hence, this loader only checks for the official 6.1 release version (or newer). After loading BCEL, DynComp will make an additional check to verify that the 6.4.1.1 version has been loaded.
There are two classes present in 6.1 and subsequent releases that are not in previous versions. Thus, we can identify version 6.1 (and later) of BCEL by the presence of the class: org.apache.bcel.classfile.ConstantModule.class.
Earlier versions of Chicory inspected all version of BCEL found on the path and selected the correct one, if present. We now (9/15/16) simplify this to say the first BCEL found must be the correct one. This allows us to use the normal loader for all of the classes.
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleLog
debug
Log file if verbose is enabled.
-
Constructor Summary
Constructors Constructor Description ChicoryLoader()
Constructor for special BCEL class loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>
loadClass(@BinaryName String name, boolean resolve)
-
Methods inherited from class 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
-
-
-
-
Field Detail
-
debug
public static final SimpleLog debug
Log file if verbose is enabled.
-
-
Constructor Detail
-
ChicoryLoader
public ChicoryLoader() throws IOException
Constructor for special BCEL class loader.- Throws:
IOException
- if unable to load class
-
-
Method Detail
-
loadClass
protected Class<?> loadClass(@BinaryName String name, boolean resolve) throws ClassNotFoundException
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
-