diff options
author | Roel Spilker <r.spilker@gmail.com> | 2010-08-08 22:27:22 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2010-08-08 22:27:22 +0200 |
commit | d4247f2e8b048d6cae83d5f93d59c7591309e65c (patch) | |
tree | 248f17cc65855720b3e7d9127170eace931e2fdb /src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | |
parent | 2683c24ee96fd7228198512f5cfcb2fd0b0cfabd (diff) | |
download | lombok-d4247f2e8b048d6cae83d5f93d59c7591309e65c.tar.gz lombok-d4247f2e8b048d6cae83d5f93d59c7591309e65c.tar.bz2 lombok-d4247f2e8b048d6cae83d5f93d59c7591309e65c.zip |
Post-compilation works in both Eclipse and ecj
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index bb3d90f7..48103a98 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java @@ -22,10 +22,16 @@ package lombok.eclipse.agent; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.OutputStream; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import lombok.core.DiagnosticsReceiver; +import lombok.core.PostCompiler; + import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.SimpleName; @@ -107,4 +113,17 @@ public class PatchFixes { } return newSimpleNames; } + + public static byte[] runPostCompiler(byte[] bytes, String className) { + byte[] transformed = PostCompiler.applyTransformations(bytes, className, DiagnosticsReceiver.CONSOLE); + return transformed == null ? bytes : transformed; + } + + public static OutputStream runPostCompiler(OutputStream out) throws IOException { + return PostCompiler.wrapOutputStream(out, "TEST", DiagnosticsReceiver.CONSOLE); + } + + public static BufferedOutputStream runPostCompiler(BufferedOutputStream out) throws IOException { + return new BufferedOutputStream(PostCompiler.wrapOutputStream(out, "TEST", DiagnosticsReceiver.CONSOLE)); + } } |