diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-23 07:44:13 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-23 07:44:13 +0200 |
commit | 21717cec11d5a8abdc3eba280290a65103bbeaf7 (patch) | |
tree | e18670cc2fb662d3e3069ed9632de23131e8ec46 /src_eclipseagent/lombok/eclipse/agent/EclipseASTConverterTransformer.java | |
parent | 21ea5eeca8448c8880a3f2d975dee3107e3175b3 (diff) | |
download | lombok-21717cec11d5a8abdc3eba280290a65103bbeaf7.tar.gz lombok-21717cec11d5a8abdc3eba280290a65103bbeaf7.tar.bz2 lombok-21717cec11d5a8abdc3eba280290a65103bbeaf7.zip |
BIIG change to the eclipse agent: Now all patcher classes represent themselves via SPI. LinkedNOdeFinderTransformer is broken.
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"; + } } |