better log description, handling -> found

This commit is contained in:
金戟 2021-04-05 15:52:12 +08:00
parent d4a69528a7
commit c393d40d0d
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ public class SourceClassHandler extends BaseClassHandler {
private void transformMethod(MethodNode mn, Set<MethodInfo> memberInjectMethods, private void transformMethod(MethodNode mn, Set<MethodInfo> memberInjectMethods,
Set<MethodInfo> newOperatorInjectMethods) { Set<MethodInfo> newOperatorInjectMethods) {
LogUtil.diagnose(" Handling method %s", mn.name); LogUtil.diagnose(" Found method %s", mn.name);
AbstractInsnNode[] instructions = mn.instructions.toArray(); AbstractInsnNode[] instructions = mn.instructions.toArray();
if (instructions.length == 0) { if (instructions.length == 0) {
// native method (issue-52) // native method (issue-52)

View File

@ -66,14 +66,14 @@ public class TestableClassTransformer implements ClassFileTransformer {
try { try {
if (mockClassParser.isMockClass(cn)) { if (mockClassParser.isMockClass(cn)) {
// it's a mock class // it's a mock class
LogUtil.diagnose("Handling mock class %s", className); LogUtil.diagnose("Found mock class %s", className);
bytes = new MockClassHandler(className).getBytes(bytes); bytes = new MockClassHandler(className).getBytes(bytes);
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes); BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
} else { } else {
String mockClass = foundMockForTestClass(className); String mockClass = foundMockForTestClass(className);
if (mockClass != null) { if (mockClass != null) {
// it's a test class with testable enabled // it's a test class with testable enabled
LogUtil.diagnose("Handling test class %s", className); LogUtil.diagnose("Found test class %s", className);
bytes = new TestClassHandler().getBytes(bytes); bytes = new TestClassHandler().getBytes(bytes);
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes); BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
} else { } else {
@ -81,7 +81,7 @@ public class TestableClassTransformer implements ClassFileTransformer {
if (mockClass != null) { if (mockClass != null) {
// it's a source class with testable enabled // it's a source class with testable enabled
List<MethodInfo> injectMethods = mockClassParser.getTestableMockMethods(mockClass); List<MethodInfo> injectMethods = mockClassParser.getTestableMockMethods(mockClass);
LogUtil.diagnose("Handling source class %s", className); LogUtil.diagnose("Found source class %s", className);
bytes = new SourceClassHandler(injectMethods, mockClass).getBytes(bytes); bytes = new SourceClassHandler(injectMethods, mockClass).getBytes(bytes);
BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes); BytecodeUtil.dumpByte(className, GlobalConfig.getDumpPath(), bytes);
} }