aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-12-23 03:35:35 +0100
committerReinier Zwitserloot <reinier@tipit.to>2009-12-23 03:35:35 +0100
commitb719e47e2d47be40141634bd9db1b47b0bf75192 (patch)
tree1c320026b93e7ff1fa7c4ef1ab9d9f6ebcecfacb /src
parentf9264b78e47262cd285e9c219954a5c5120cb25e (diff)
downloadlombok-b719e47e2d47be40141634bd9db1b47b0bf75192.tar.gz
lombok-b719e47e2d47be40141634bd9db1b47b0bf75192.tar.bz2
lombok-b719e47e2d47be40141634bd9db1b47b0bf75192.zip
prep for this class working better for ecj.
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/TransformEclipseAST.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/lombok/eclipse/TransformEclipseAST.java b/src/core/lombok/eclipse/TransformEclipseAST.java
index 3b5482ca..dff11442 100644
--- a/src/core/lombok/eclipse/TransformEclipseAST.java
+++ b/src/core/lombok/eclipse/TransformEclipseAST.java
@@ -57,10 +57,10 @@ public class TransformEclipseAST {
static {
Field f = null;
- HandlerLibrary l = null;
+ HandlerLibrary h = null;
+
try {
- l = HandlerLibrary.load();
- f = CompilationUnitDeclaration.class.getDeclaredField("$lombokAST");
+ h = HandlerLibrary.load();
} catch (Throwable t) {
try {
Eclipse.error(null, "Problem initializing lombok", t);
@@ -70,8 +70,14 @@ public class TransformEclipseAST {
}
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.
+ }
+
astCacheField = f;
- handlers = l;
+ handlers = h;
}
public static void transform_swapped(CompilationUnitDeclaration ast, Parser parser) {
@@ -86,7 +92,7 @@ public class TransformEclipseAST {
* Eclipse's parsers often operate in diet mode, which means many parts of the AST have been left blank.
* Be ready to deal with just about anything being null, such as the Statement[] arrays of the Method AST nodes.
*
- * @param parser The Eclipse parser object that generated the AST.
+ * @param parser The Eclipse parser object that generated the AST. Not actually used; mostly there to satisfy parameter rules for lombok.patcher scripts.
* @param ast The AST node belonging to the compilation unit (java speak for a single source file).
*/
public static void transform(Parser parser, CompilationUnitDeclaration ast) {