diff --git a/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/DynamicSqlSourceMonitor.java b/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/DynamicSqlSourceMonitor.java index bfde45c..835daf0 100644 --- a/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/DynamicSqlSourceMonitor.java +++ b/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/DynamicSqlSourceMonitor.java @@ -4,12 +4,6 @@ import com.plugins.mybaitslog.IClassFileTransformer; import javassist.*; -import java.lang.instrument.ClassFileTransformer; -import java.lang.instrument.IllegalClassFormatException; -import java.security.ProtectionDomain; - -import com.linkkou.mybatis.log.SubInterceptorChain; - /** * A DynamicSqlSourceMonitor Class * diff --git a/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/RawSqlSourceMonitor.java b/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/RawSqlSourceMonitor.java index 074b2bf..e70bb45 100644 --- a/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/RawSqlSourceMonitor.java +++ b/mybatis-agent/src/main/java/com/plugins/mybaitslog/monitor/RawSqlSourceMonitor.java @@ -40,7 +40,7 @@ public void transform() { final CtConstructor declaredConstructor = ctClass.getDeclaredConstructor(new CtClass[]{classPool.getCtClass("org.apache.ibatis.session.Configuration"), classPool.getCtClass("java.lang.String"), classPool.getCtClass("java.lang.Class")}); declaredConstructor.insertAfter("{$0._rootSqlNode_ = $2;}"); //写入 - ctClass.writeFile(); + //ctClass.writeFile(); //加载该类的字节码(不能少) ctClass.toClass(LogInterceptor.class.getClassLoader(), LogInterceptor.class.getProtectionDomain()); ctClass.detach();