diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-01 00:08:40 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-09-01 00:08:40 +0200 |
commit | 72cc800fd0c3e122a71a42536d5ced5297d6fa4e (patch) | |
tree | bc3e6677f50bb7ca9955857ae0a0ae6484bf0332 /src/lombok | |
parent | 65b9365b5419f69ac78ad895308024b4bac15fbd (diff) | |
download | lombok-72cc800fd0c3e122a71a42536d5ced5297d6fa4e.tar.gz lombok-72cc800fd0c3e122a71a42536d5ced5297d6fa4e.tar.bz2 lombok-72cc800fd0c3e122a71a42536d5ced5297d6fa4e.zip |
Fixed issue #26: Starting eclipse's help feature just shows you a 500 error, ond depending on your eclipse version, a long stack trace.
The problem boiled down to the JSP compiler used by the help system also being instrumented with lombok, but that's not exactly the environment lombok was expecting. Fixed by simply disabling lombok when the environments don't match what we expect. In the process, the instrumentation has been made a little more robust; multiple separate OSGi modules can all be instrumented now, instead of the first one winning.
Diffstat (limited to 'src/lombok')
-rw-r--r-- | src/lombok/eclipse/TransformEclipseAST.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lombok/eclipse/TransformEclipseAST.java b/src/lombok/eclipse/TransformEclipseAST.java index ff40c110..9bc3326f 100644 --- a/src/lombok/eclipse/TransformEclipseAST.java +++ b/src/lombok/eclipse/TransformEclipseAST.java @@ -96,7 +96,17 @@ public class TransformEclipseAST { EclipseAST.addProblemToCompilationResult(ast, false, message, 0, 0); t.printStackTrace(); } catch ( Throwable t2 ) { - Eclipse.error(ast, "Can't create an error in the problems dialog while adding: " + t.toString(), t2); + try { + Eclipse.error(ast, "Can't create an error in the problems dialog while adding: " + t.toString(), t2); + } catch ( Throwable t3 ) { + //This seems risky to just silently turn off lombok, but if we get this far, something pretty + //drastic went wrong. For example, the eclipse help system's JSP compiler will trigger a lombok call, + //but due to class loader shenanigans we'll actually get here due to a cascade of + //ClassNotFoundErrors. This is the right action for the help system (no lombok needed for that JSP compiler, + //of course). 'disableLombok' is static, but each context classloader (e.g. each eclipse OSGi plugin) has + //it's own edition of this class, so this won't turn off lombok everywhere. + disableLombok = true; + } } } } |