add ClassLoaderAwareClassWriter to fix getCommonSuperClass ClassNotFoundException problem. #1218

This commit is contained in:
hengyunabc
2020-05-29 15:36:08 +08:00
parent ac3e188d49
commit 8e06b400bc
3 changed files with 65 additions and 1 deletions
@@ -300,7 +300,7 @@ public class Enhancer implements ClassFileTransformer {
affect.addMethodAndCount(inClassLoader, className, methodNode.name, methodNode.desc);
}
byte[] enhanceClassByteArray = AsmUtils.toBytes(classNode);
byte[] enhanceClassByteArray = AsmUtils.toBytes(classNode, inClassLoader);
// 增强成功,记录类
classBytesCache.put(classBeingRedefined, new Object());