diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-28 09:14:41 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-08-28 09:17:01 +0200 |
commit | 70256754c2587361c9f70287f62c1e3fd2dede10 (patch) | |
tree | 464b128f4e7453760a714f9a2fad67e644c09482 /src/core/lombok/eclipse | |
parent | 672ddda8f5b27b0a97ff00413edf6d159885d636 (diff) | |
download | lombok-70256754c2587361c9f70287f62c1e3fd2dede10.tar.gz lombok-70256754c2587361c9f70287f62c1e3fd2dede10.tar.bz2 lombok-70256754c2587361c9f70287f62c1e3fd2dede10.zip |
If the JVM is started with -Dlombok.disable, lombok is disabled entirely for both eclipse/ecj and javac operations.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/TransformEclipseAST.java | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/core/lombok/eclipse/TransformEclipseAST.java b/src/core/lombok/eclipse/TransformEclipseAST.java index 63783734..89d23fbd 100644 --- a/src/core/lombok/eclipse/TransformEclipseAST.java +++ b/src/core/lombok/eclipse/TransformEclipseAST.java @@ -62,25 +62,31 @@ public class TransformEclipseAST { Field f = null; HandlerLibrary h = null; - try { - h = HandlerLibrary.load(); - } catch (Throwable t) { + if (System.getProperty("lombok.disable") != null) { + disableLombok = true; + astCacheField = null; + handlers = null; + } else { try { - error(null, "Problem initializing lombok", t); - } catch (Throwable t2) { - System.err.println("Problem initializing lombok"); - t.printStackTrace(); + h = HandlerLibrary.load(); + } catch (Throwable t) { + try { + error(null, "Problem initializing lombok", t); + } catch (Throwable t2) { + System.err.println("Problem initializing lombok"); + t.printStackTrace(); + } + disableLombok = true; } - disableLombok = true; - } - try { - f = CompilationUnitDeclaration.class.getDeclaredField("$lombokAST"); - } catch (Throwable t) { - //I guess we're in an ecj environment; we'll just not cache stuff then. + try { + f = CompilationUnitDeclaration.class.getDeclaredField("$lombokAST"); + } catch (Throwable t) { + //I guess we're in an ecj environment; we'll just not cache stuff then. + } + + astCacheField = f; + handlers = h; } - - astCacheField = f; - handlers = h; } public static void transform_swapped(CompilationUnitDeclaration ast, Parser parser) { |