fit for frame-full opcode used by jacoco

This commit is contained in:
金戟 2021-02-18 12:45:10 +08:00
parent c76ed2d84a
commit 6a5c817a3a
2 changed files with 3 additions and 1 deletions

View File

@ -99,6 +99,8 @@ public class MockClassHandler extends BaseClassWithContextHandler {
((IincInsnNode)in).var++;
} else if (in instanceof VarInsnNode && ((VarInsnNode)in).var > 0) {
((VarInsnNode)in).var++;
} else if (in instanceof FrameNode && ((FrameNode)in).type == F_FULL) {
((FrameNode)in).local.add(1, targetClassName);
}
}
mn.maxLocals++;

View File

@ -41,7 +41,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
* Just avoid spend time to scan those surely non-user classes Should keep these lists as tiny as possible
*/
private final String[] WHITELIST_PREFIXES = new String[] {"com/alibaba/testable/demo/"};
private final String[] BLACKLIST_PREFIXES = new String[] {"jdk/", "java/", "javax/", "com/sun/",
private final String[] BLACKLIST_PREFIXES = new String[] {"jdk/", "java/", "javax/", "sun/", "com/sun/",
"org/apache/maven/", "com/alibaba/testable/", "junit/", "org/junit/", "org/testng/"};
public MockClassParser mockClassParser = new MockClassParser();