HHH-10112 - [enhancer] Use loading classloader in ClassPool
This commit is contained in:
parent
cd7212a1e8
commit
a11d2e7783
|
@ -93,8 +93,14 @@ public class Enhancer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ClassPool buildClassPool(EnhancementContext enhancementContext) {
|
private ClassPool buildClassPool(final EnhancementContext enhancementContext) {
|
||||||
final ClassPool classPool = new ClassPool( false );
|
final ClassPool classPool = new ClassPool( false ) {
|
||||||
|
@Override
|
||||||
|
public ClassLoader getClassLoader() {
|
||||||
|
return enhancementContext.getLoadingClassLoader();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
final ClassLoader loadingClassLoader = enhancementContext.getLoadingClassLoader();
|
final ClassLoader loadingClassLoader = enhancementContext.getLoadingClassLoader();
|
||||||
if ( loadingClassLoader != null ) {
|
if ( loadingClassLoader != null ) {
|
||||||
classPool.appendClassPath( new LoaderClassPath( loadingClassLoader ) );
|
classPool.appendClassPath( new LoaderClassPath( loadingClassLoader ) );
|
||||||
|
|
Loading…
Reference in New Issue