diff options
Diffstat (limited to 'src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java')
-rw-r--r-- | src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java b/src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java index 1402138b..4245e246 100644 --- a/src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java +++ b/src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java @@ -21,6 +21,7 @@ */ package lombok.eclipse.agent; +import org.mangosdk.spi.ProviderFor; import org.objectweb.asm.ClassAdapter; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; @@ -41,8 +42,9 @@ import org.objectweb.asm.Opcodes; * <li>The <code>retrieveStartingCatchPosition(int, int)</code> method is instrumented to return its first parameter * instead of the constant -1.</li></ul> */ -class EclipseASTConverterTransformer { - byte[] transform(byte[] classfileBuffer) { +@ProviderFor(EclipseTransformer.class) +public class EclipseASTConverterTransformer implements EclipseTransformer { + public byte[] transform(byte[] classfileBuffer) { ClassReader reader = new ClassReader(classfileBuffer); ClassWriter writer = new ClassWriter(reader, 0); @@ -51,17 +53,6 @@ class EclipseASTConverterTransformer { return writer.toByteArray(); } - static RuntimeException sneakyThrow(Throwable t) { - if ( t == null ) throw new NullPointerException("t"); - EclipseASTConverterTransformer.<RuntimeException>sneakyThrow0(t); - return null; - } - - @SuppressWarnings("unchecked") - private static <T extends Throwable> void sneakyThrow0(Throwable t) throws T { - throw (T)t; - } - private static class ASTConverterPatcherAdapter extends ClassAdapter { public ASTConverterPatcherAdapter(ClassVisitor cv) { super(cv); @@ -97,4 +88,8 @@ class EclipseASTConverterTransformer { } } } + + @Override public String getTargetClassName() { + return "org/eclipse/jdt/core/dom/ASTConverter"; + } } |