diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-21 01:11:38 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-01-21 01:11:38 +0100 |
commit | d9572c05b109d82ebe7455fbb16d8fe845bddbe5 (patch) | |
tree | 68633063fae81bf0a8173a8288e32c850a06d4ef /src/eclipseAgent/lombok | |
parent | cd139f46355ea01276c2ae13248a2aca5111678a (diff) | |
download | lombok-d9572c05b109d82ebe7455fbb16d8fe845bddbe5.tar.gz lombok-d9572c05b109d82ebe7455fbb16d8fe845bddbe5.tar.bz2 lombok-d9572c05b109d82ebe7455fbb16d8fe845bddbe5.zip |
Fix for erroneous use of val in basic fors.
Diffstat (limited to 'src/eclipseAgent/lombok')
-rw-r--r-- | src/eclipseAgent/lombok/eclipse/agent/PatchVal.java | 4 |
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) { |