mirror of https://github.com/sbt/sbt.git
Jave reflection did not work with layered classloaders if a dependency attempted to load a class that was below the dependency layer in the layered classloader hierarchy. The underlying problem was (in general) a call to Class.forName somewhere. If the classloader parameter is not specified, then Class.forName locates the ClassLoader for the caller using reflection. It ultimately delegates to that ClassLoader's loadClass method. With the previous LayeredClassLoader class, there was no way for that classloader to access a URL that was below it in the class loading hierarchy. I reworked LayeredClassLoader so that if it fails to load the class, it will check the Thread's context classloader and see if there are other LayeredClassLoader instances below it. If so, it will then check if any of those classloaders would be able to load the class by using findResource. If the descendant loader can load the class, then we manually load it with findClass. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||