aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchVal.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
index e734dceb..1379719d 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
@@ -128,7 +128,9 @@ public class PatchVal {
if (!isVal(local.type, scope)) return false;
- if (new Throwable().getStackTrace()[2].getClassName().contains("ForStatement")) 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;
Expression init = local.initialization;
if (init == null && Reflection.initCopyField != null) {