aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-07-14 14:40:57 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-07-18 22:14:18 +0200
commit43b3f2c0f0b3c519e84d221d4d6a5f41b74e2ec0 (patch)
tree2e7b39bd45b238059e305392b2550842ef8974a6 /src/core/lombok/eclipse
parent43d938a895323e3bae807ea534de10a13b66ad24 (diff)
downloadlombok-43b3f2c0f0b3c519e84d221d4d6a5f41b74e2ec0.tar.gz
lombok-43b3f2c0f0b3c519e84d221d4d6a5f41b74e2ec0.tar.bz2
lombok-43b3f2c0f0b3c519e84d221d4d6a5f41b74e2ec0.zip
back-in-time debugging added. Of course now 164 isn't triggering anymore :/
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/TransformEclipseAST.java4
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/core/lombok/eclipse/TransformEclipseAST.java b/src/core/lombok/eclipse/TransformEclipseAST.java
index 7ef06fca..b362f399 100644
--- a/src/core/lombok/eclipse/TransformEclipseAST.java
+++ b/src/core/lombok/eclipse/TransformEclipseAST.java
@@ -23,6 +23,7 @@ package lombok.eclipse;
import java.lang.reflect.Field;
+import lombok.core.debug.DebugSnapshotStore;
import lombok.patcher.Symbols;
import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
@@ -126,9 +127,12 @@ public class TransformEclipseAST {
// Do NOT abort if (ast.bits & ASTNode.HasAllMethodBodies) != 0 - that doesn't work.
try {
+ DebugSnapshotStore.INSTANCE.snapshot(ast, "transform entry");
EclipseAST existing = getAST(ast, false);
new TransformEclipseAST(existing).go();
+ DebugSnapshotStore.INSTANCE.snapshot(ast, "transform exit");
} catch (Throwable t) {
+ DebugSnapshotStore.INSTANCE.snapshot(ast, "transform error: %s", t.getClass().getSimpleName());
try {
String message = "Lombok can't parse this source: " + t.toString();
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 627acecb..5f6691fd 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -25,6 +25,7 @@ import static lombok.eclipse.Eclipse.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
@@ -37,6 +38,7 @@ import lombok.Getter;
import lombok.Lombok;
import lombok.core.AnnotationValues;
import lombok.core.AST.Kind;
+import lombok.core.debug.DebugSnapshotStore;
import lombok.core.handlers.TransformationsUtil;
import lombok.eclipse.Eclipse;
import lombok.eclipse.EclipseNode;
@@ -464,9 +466,11 @@ public class EclipseHandlerUtil {
}
if (report) {
- Eclipse.warning("We believe you may have just stumbled on lombok issue #164. Please " +
- "report the stack trace associated with this message at:\n" +
- "http://code.google.com/p/projectlombok/issues/detail?id=164", new Throwable());
+ CompilationUnitDeclaration cud = (CompilationUnitDeclaration) type.top().get();
+ DebugSnapshotStore.INSTANCE.print(cud, "Printing: injecting whilst scope is already built.");
+// Eclipse.warning("State: " + Issue164Fixer.getState(cud) + " -- We believe you may have just stumbled on lombok issue #164. Please " +
+// "report the stack trace associated with this message at:\n" +
+// "http://code.google.com/p/projectlombok/issues/detail?id=164. Occurred on class " + new String(parent.name), new Throwable());
}
}