diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-01 21:08:10 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-01 21:08:10 +0200 |
commit | af202da7db529e1c98344343e29c82a3689df2d6 (patch) | |
tree | 8f59f5574d169363fb844cafa5b6bcc8eeb4061f /src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java | |
parent | da367086c56b1a21a549a81d66d6f85ae04709fd (diff) | |
download | lombok-af202da7db529e1c98344343e29c82a3689df2d6.tar.gz lombok-af202da7db529e1c98344343e29c82a3689df2d6.tar.bz2 lombok-af202da7db529e1c98344343e29c82a3689df2d6.zip |
Added a simple rewriter to the catch block finder of ASTConverter: If it can't find it, it used to return -1, which is exceedingly useless and causes no end of bugs. Changed it to returning the start point of the search, which is a more useful fallback.
Diffstat (limited to 'src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r-- | src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java b/src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java index 02cc533d..67371948 100644 --- a/src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src_eclipseagent/lombok/eclipse/agent/EclipsePatcher.java @@ -71,6 +71,15 @@ public class EclipsePatcher { } } + if ( ECLIPSE_ASTCONVERTER_CLASS_NAME.equals(className) ) { + try { + return runTransform("lombok.eclipse.agent.EclipseASTConverterTransformer", classfileBuffer); + } catch ( Throwable t ) { + System.err.println("Wasn't able to patch eclipse's ASTConverter class:"); + t.printStackTrace(); + } + } + return null; } } @@ -87,6 +96,7 @@ public class EclipsePatcher { 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"; + static final String ECLIPSE_ASTCONVERTER_CLASS_NAME = "org/eclipse/jdt/core/dom/ASTConverter"; public static void agentmain(String agentArgs, Instrumentation instrumentation) throws Exception { registerPatcher(instrumentation, true); |