In InferenceMain#getRealChecker() and InferenceMain#getSolver(), we have code using URLClassLoader to load Checker class and Solver class.
However, this code is confusing and misleading, because the parent directory of checker-framework-Inference is never an effective bin dir that directly contains .class files. Also, an instance of URLClassLoader will not do a recursive searching of it's URLs, which means the URLClassLoader will never load classes by itself.
The previous code accidentally works when shell script has export classpath of Checker and Solver in environment variable CLASSPATH. This is because SystemClassLoader is an ancestor class of URLClassLoader, and thus the class files of Checker and Solver is actually loaded by SystemClassLoader through env variable CLASSPATH.
To make code be clearer on it's real behaviour, I changed code to explicitly call SystemClassLoader to load Checker and Solver class files.
In
InferenceMain#getRealChecker(
) andInferenceMain#getSolver()
, we have code usingURLClassLoader
to load Checker class and Solver class.However, this code is confusing and misleading, because the parent directory of
checker-framework-Inference
is never an effectivebin dir
that directly contains .class files. Also, an instance ofURLClassLoader
will not do a recursive searching of it's URLs, which means theURLClassLoader
will never load classes by itself.The previous code accidentally works when shell script has export classpath of Checker and Solver in environment variable
CLASSPATH
. This is becauseSystemClassLoader
is an ancestor class ofURLClassLoader
, and thus the class files of Checker and Solver is actually loaded bySystemClassLoader
through env variableCLASSPATH
.To make code be clearer on it's real behaviour, I changed code to explicitly call
SystemClassLoader
to load Checker and Solver class files.