From 3f408782de736a676ee19757894eb89c1f4ebf3b Mon Sep 17 00:00:00 2001 From: peichhorn Date: Thu, 19 Apr 2012 02:41:31 +0200 Subject: fixed: @val didn't work with rawtypes in enhanced for loops --- src/eclipseAgent/lombok/eclipse/agent/PatchVal.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java index 6563c20a..16f11769 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java @@ -189,7 +189,8 @@ public class PatchVal { private static TypeBinding getForEachComponentType(Expression collection, BlockScope scope) { if (collection != null) { - TypeBinding resolved = collection.resolveType(scope); + TypeBinding resolved = collection.resolvedType; + if (resolved == null) resolved = collection.resolveType(scope); if (resolved == null) return null; if (resolved.isArrayType()) { resolved = ((ArrayBinding) resolved).elementsType(); @@ -205,6 +206,8 @@ public class PatchVal { case Binding.PARAMETERIZED_TYPE : // for(E e : Iterable) arguments = ((ParameterizedTypeBinding)iterableType).arguments; break; + case Binding.RAW_TYPE : // for(Object e : Iterable) + return null; } if (arguments != null && arguments.length == 1) { -- cgit