diff options
author | Roel Spilker <r.spilker@gmail.com> | 2011-05-03 02:26:15 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2011-05-03 02:26:15 +0200 |
commit | b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59 (patch) | |
tree | 5b9aa50af1f0b8648d8083bfe9f95e4f0ac4b618 /src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | |
parent | e5e35213780a87c813b892d5efc1288125980baf (diff) | |
parent | 12e4f36a2f5aae5b17266fb15376c82d74b7bf95 (diff) | |
download | lombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.tar.gz lombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.tar.bz2 lombok-b93a58298556aedaeef9e3d5fa4e53bc9b0ebe59.zip |
Merge branch 'master' of git@github.com:rzwitserloot/lombok
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 21 |
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 a2867c39..4d397a3c 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -506,6 +506,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; |