aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2015-01-21 01:28:36 +0100
committerRoel Spilker <r.spilker@gmail.com>2015-01-21 01:28:36 +0100
commit20bd5dce06112d87261f2997c6a575662b42488f (patch)
treec2e565bcc4645040775f1427b5c9c5cbe6584571 /src/eclipseAgent/lombok
parentd9572c05b109d82ebe7455fbb16d8fe845bddbe5 (diff)
downloadlombok-20bd5dce06112d87261f2997c6a575662b42488f.tar.gz
lombok-20bd5dce06112d87261f2997c6a575662b42488f.tar.bz2
lombok-20bd5dce06112d87261f2997c6a575662b42488f.zip
the previous basic for fix didn't really work, this one is better.
Diffstat (limited to 'src/eclipseAgent/lombok')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchVal.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
index 1379719d..30574ea6 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
@@ -129,8 +129,13 @@ public class PatchVal {
if (!isVal(local.type, scope)) return false;
StackTraceElement[] st = new Throwable().getStackTrace();
- if (st.length > 2 && st[2].getClassName().contains("ForStatement")) return false;
- if (st.length > 8 && st[8].getClassName().contains("ForStatement")) return false;
+ for (int i = 0; i < st.length - 2 && i < 10; i++) {
+ if (st[i].getClassName().equals("lombok.launch.PatchFixesHider$Val")) {
+ if (st[i + 1].getClassName().equals("org.eclipse.jdt.internal.compiler.ast.LocalDeclaration") &&
+ st[i + 2].getClassName().equals("org.eclipse.jdt.internal.compiler.ast.ForStatement")) return false;
+ break;
+ }
+ }
Expression init = local.initialization;
if (init == null && Reflection.initCopyField != null) {