diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-08-15 22:59:49 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-08-15 22:59:49 +0200 |
commit | 240473a6c214679362bb3544ea414716f4c2062a (patch) | |
tree | e06ebd0e412cd8454ad1649d94c5e0919c4fa76e /src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | |
parent | 81cfc844b90d347c01ec9e68dcd7554a75caa733 (diff) | |
parent | 4c23804837e854c4f4ebb0008b10241467550d3f (diff) | |
download | lombok-240473a6c214679362bb3544ea414716f4c2062a.tar.gz lombok-240473a6c214679362bb3544ea414716f4c2062a.tar.bz2 lombok-240473a6c214679362bb3544ea414716f4c2062a.zip |
Merge branch 'postProcess'
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java index bb3d90f7..b9bfe22b 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,18 @@ 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, String path, String name) throws IOException { + String fileName = path + "/" + name; + return new BufferedOutputStream(PostCompiler.wrapOutputStream(out, fileName, DiagnosticsReceiver.CONSOLE)); + } } |