aboutsummaryrefslogtreecommitdiff
path: root/src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-06-12 08:37:38 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-06-12 08:37:38 +0200
commit7d24f9c9a52861ced99f419edb07533f9b99a7ed (patch)
tree622022f053d6c835db661938cca61ee9c58a2d0d /src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java
parent0ef67926087ed2a6878e8b1c32f387b135c1d3df (diff)
downloadlombok-7d24f9c9a52861ced99f419edb07533f9b99a7ed.tar.gz
lombok-7d24f9c9a52861ced99f419edb07533f9b99a7ed.tar.bz2
lombok-7d24f9c9a52861ced99f419edb07533f9b99a7ed.zip
Removed the WeakHashMap for caching EclipseAST objects; obviously wasn't working due to
circular reference from the EclipseAST back to the CUD. Now, patched a field into CompilationUnitDeclaration and using that, which works much better together with the garbage collector.
Diffstat (limited to 'src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java')
-rw-r--r--src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java b/src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java
index abe26683..81309b34 100644
--- a/src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java
+++ b/src_eclipseagent/lombok/agent/eclipse/EclipseParserPatcher.java
@@ -13,12 +13,21 @@ public class EclipseParserPatcher {
ProtectionDomain protectionDomain, byte[] classfileBuffer)
throws IllegalClassFormatException {
- if ( !ECLIPSE_PARSER_CLASS_NAME.equals(className) ) return null;
- EclipseParserTransformer transformer = new EclipseParserTransformer(classfileBuffer);
- return transformer.transform();
+ if ( ECLIPSE_PARSER_CLASS_NAME.equals(className) ) {
+ EclipseParserTransformer transformer = new EclipseParserTransformer(classfileBuffer);
+ return transformer.transform();
+ }
+
+ if ( ECLIPSE_CUD_CLASS_NAME.equals(className) ) {
+ EclipseCUDTransformer transformer = new EclipseCUDTransformer(classfileBuffer);
+ return transformer.transform();
+ }
+
+ return null;
}
}
-
+
+ static final String ECLIPSE_CUD_CLASS_NAME = "org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration";
static final String ECLIPSE_PARSER_CLASS_NAME = "org/eclipse/jdt/internal/compiler/parser/Parser";
public static void agentmain(String agentArgs, Instrumentation instrumentation) {