From 43b3f2c0f0b3c519e84d221d4d6a5f41b74e2ec0 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 14 Jul 2011 14:40:57 +0200 Subject: back-in-time debugging added. Of course now 164 isn't triggering anymore :/ --- src/core/lombok/eclipse/TransformEclipseAST.java | 4 ++++ src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/core') 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()); } } -- cgit