rename
This commit is contained in:
parent
a73acb9ddb
commit
600589edc3
1 changed files with 3 additions and 3 deletions
|
|
@ -22,12 +22,12 @@ public class Agent {
|
||||||
instrumentation.addTransformer(new ClassFileTransformer() {
|
instrumentation.addTransformer(new ClassFileTransformer() {
|
||||||
@Override
|
@Override
|
||||||
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
||||||
return instrumentExceptionLoggerAtThrow(className, classfileBuffer);
|
return injectExceptionLoggerBeforeThrow(className, classfileBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] transform(Module module, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
public byte[] transform(Module module, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
|
||||||
return instrumentExceptionLoggerAtThrow(className, classfileBuffer);
|
return injectExceptionLoggerBeforeThrow(className, classfileBuffer);
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +35,7 @@ public class Agent {
|
||||||
/*
|
/*
|
||||||
* Every throw opcode will be preceded by a call to our ExceptionLogger
|
* Every throw opcode will be preceded by a call to our ExceptionLogger
|
||||||
*/
|
*/
|
||||||
private static byte[] instrumentExceptionLoggerAtThrow(String className, byte[] classfileBuffer) {
|
private static byte[] injectExceptionLoggerBeforeThrow(String className, byte[] classfileBuffer) {
|
||||||
var classFile = ClassFile.of();
|
var classFile = ClassFile.of();
|
||||||
var classModel = classFile.parse(classfileBuffer);
|
var classModel = classFile.parse(classfileBuffer);
|
||||||
return classFile.build(classModel.thisClass().asSymbol(), classBuilder -> {
|
return classFile.build(classModel.thisClass().asSymbol(), classBuilder -> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue