use of org.objectweb.asm.commons.Remapper in project pinpoint by naver.
the class LambdaFactoryTest method renameClass.
private void renameClass(ClassReader reader, ClassVisitor classVisitor) {
String className = "com/navercorp/pinpoint/profiler/instrument/lambda/mock/UnsafeClassMock";
Remapper remapper = new SimpleRemapper(className, className + "2");
ClassRemapper classRemapper = new ClassRemapper(classVisitor, remapper);
reader.accept(classRemapper, 0);
}
use of org.objectweb.asm.commons.Remapper in project robolectric by robolectric.
the class ClassInstrumentor method instrumentToBytes.
byte[] instrumentToBytes(MutableClass mutableClass) {
instrument(mutableClass);
ClassNode classNode = mutableClass.classNode;
ClassWriter writer = new InstrumentingClassWriter(mutableClass.classNodeProvider, classNode);
Remapper remapper = new Remapper() {
@Override
public String map(final String internalName) {
return mutableClass.config.mappedTypeName(internalName);
}
};
ClassRemapper visitor = new ClassRemapper(writer, remapper);
classNode.accept(visitor);
return writer.toByteArray();
}
Aggregations