should convert package prefix to slash separated format

This commit is contained in:
金戟 2021-04-17 19:52:32 +08:00
parent 5921ccab07
commit eec88f4bd9
3 changed files with 5 additions and 3 deletions

View File

@ -49,6 +49,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
// Ignore system class and reloaded class
return null;
}
// className is in slash-separated format
LogUtil.verbose("Handle class: " + className);
byte[] bytes = shouldOmniEnhance(className) ? new OmniClassHandler().getBytes(classFileBuffer) : classFileBuffer;
ClassNode cn = ClassUtil.getClassNode(className);

View File

@ -11,6 +11,8 @@ import java.util.List;
import static com.alibaba.testable.agent.constant.ConstPool.PROPERTY_TEMP_DIR;
import static com.alibaba.testable.agent.constant.ConstPool.PROPERTY_USER_DIR;
import static com.alibaba.testable.core.constant.ConstPool.COMMA;
import static com.alibaba.testable.core.constant.ConstPool.DOT;
import static com.alibaba.testable.core.util.PathUtil.createFolder;
/**
@ -22,8 +24,6 @@ public class GlobalConfig {
private static final String DEBUG = "debug";
private static final String VERBOSE = "verbose";
private static final String DISABLE_LOG_FILE = "null";
private static final String COMMA = ",";
private static final String DOT = ".";
private static final String TESTABLE_AGENT_LOG = "testable-agent.log";
private static final String DEFAULT_MAVEN_OUTPUT_FOLDER = "target";
private static final String DEFAULT_GRADLE_OUTPUT_FOLDER = "gradle";
@ -142,7 +142,7 @@ public class GlobalConfig {
private static List<String> parsePkgPrefixList(String prefixes) {
List<String> whiteList = new ArrayList<String>();
for (String p : prefixes.split(COMMA)) {
whiteList.add(p.endsWith(DOT) ? p : p + DOT);
whiteList.add(ClassUtil.toSlashSeparatedName(p.endsWith(DOT) ? p : p + DOT));
}
return whiteList;
}

View File

@ -21,5 +21,6 @@ public class ConstPool {
public static final String SLASH = "/";
public static final String DOLLAR = "$";
public static final String UNDERLINE = "_";
public static final String COMMA = ",";
}