aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-04-01 18:07:46 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-04-01 18:07:46 +0200
commit1a589ca221a172845a108a6c759018c6e25d5cdd (patch)
treea6e486c1fd5947d2d29a5c6799531ed1948f2f6d /src/core/lombok/eclipse
parent7ebf05aaec0c4ed0e70a3a2a8a0f56afd029bd46 (diff)
downloadlombok-1a589ca221a172845a108a6c759018c6e25d5cdd.tar.gz
lombok-1a589ca221a172845a108a6c759018c6e25d5cdd.tar.bz2
lombok-1a589ca221a172845a108a6c759018c6e25d5cdd.zip
Now logging a warning with diagnostic info so that the next time
a user runs into issue #164, we can get a more useful stracktrace from them.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 860cf44f..a83ba836 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -500,6 +500,27 @@ public class EclipseHandlerUtil {
method.annotations = createSuppressWarningsAll(method, method.annotations);
TypeDeclaration parent = (TypeDeclaration) type.get();
+ if (parent.scope != null && method.scope == null) {
+ // We think this means heisenbug #164 is about to happen later in some other worker thread.
+ // To improve our ability to figure out what the heck is going on, let's generate a log so we can ask those who stumble on this about it,
+ // and thus see a far more useful stack trace.
+ boolean report = true;
+ for (StackTraceElement elem : Thread.currentThread().getStackTrace()) {
+ // We intentionally hook into the middle of ClassScope filling in BlockScopes for PatchDelegate,
+ // meaning that will trigger a false positive. Detect it and do not report the occurence of #164 if so.
+ if ("lombok.eclipse.agent.PatchDelegate".equals(elem.getClassName())) {
+ report = false;
+ break;
+ }
+ }
+
+ 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());
+ }
+ }
+
if (parent.methods == null) {
parent.methods = new AbstractMethodDeclaration[1];
parent.methods[0] = method;