Prevent possible compilation error due to non-functional ClassFileTransformer
@@ -16,8 +16,8 @@ import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InnerClassNode;
import java.io.*;
-import java.lang.instrument.ClassDefinition;
-import java.lang.instrument.Instrumentation;
+import java.lang.instrument.*;
+import java.security.ProtectionDomain;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
@@ -506,8 +506,9 @@ public class Input{
public void registerLoadListener() {
if (instrumentation == null) return;
// register transformer so new classes can be added on the fly
- instrumentation.addTransformer(
- (loader, className, classBeingRedefined, protectionDomain, classfileBuffer) -> {
+ instrumentation.addTransformer(new ClassFileTransformer() {
+ @Override
+ public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException {
// skip invalid entries
if (className == null || classfileBuffer == null) {
return classfileBuffer;
@@ -519,6 +520,7 @@ public class Input{
Logging.warn("Failed to load inst. class: " + className);
}
return classfileBuffer;
+ }
}, true);
}
