From 7bb2ed02c3891d240840110abb0a79949947cc16 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Wed, 21 Jan 2015 02:07:56 +0100 Subject: [i742][i747] Fix for ExtensionMethod broken in Eclipse using java8 --- src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/eclipseAgent/lombok') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java index 44adb333..ca0933fb 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java @@ -227,8 +227,11 @@ public class PatchExtensionMethod { if (argument.resolvedType != null) argumentTypes.add(argument.resolvedType); // TODO: Instead of just skipping nulls entirely, there is probably a 'unresolved type' placeholder. THAT is what we ought to be adding here! } + Expression[] originalArgs = methodCall.arguments; + methodCall.arguments = arguments.toArray(new Expression[0]); MethodBinding fixedBinding = scope.getMethod(extensionMethod.declaringClass, methodCall.selector, argumentTypes.toArray(new TypeBinding[0]), methodCall); if (fixedBinding instanceof ProblemMethodBinding) { + methodCall.arguments = originalArgs; if (fixedBinding.declaringClass != null) { scope.problemReporter().invalidMethod(methodCall, fixedBinding); } @@ -247,7 +250,6 @@ public class PatchExtensionMethod { arg.implicitConversion = TypeIds.UNBOXING | (id + (id << 4)); // magic see TypeIds } } - methodCall.arguments = arguments.toArray(new Expression[0]); methodCall.receiver = createNameRef(extensionMethod.declaringClass, methodCall); methodCall.actualReceiverType = extensionMethod.declaringClass; -- cgit