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