From 073f325d714e4f9a3c14d723a08d0055ad02f580 Mon Sep 17 00:00:00 2001 From: Philipp Eichhorn Date: Sun, 24 Jun 2012 21:12:05 +0200 Subject: ExtensionMethod didn't work for primitive types in eclipse.. this has been fixed --- src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/eclipseAgent/lombok') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java index 36d884b9..ebfb1a05 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java @@ -198,8 +198,6 @@ public class PatchExtensionMethod { } } - if (methodCall.binding == null) return resolvedType; - for (Extension extension : extensions) { if (!extension.suppressBaseMethods && !(methodCall.binding instanceof ProblemMethodBinding)) continue; for (MethodBinding extensionMethod : extension.extensionMethods) { @@ -212,8 +210,9 @@ public class PatchExtensionMethod { arguments.add(methodCall.receiver); if (methodCall.arguments != null) arguments.addAll(Arrays.asList(methodCall.arguments)); List argumentTypes = new ArrayList(); - argumentTypes.add(methodCall.receiver.resolvedType); - if (methodCall.binding.parameters != null) argumentTypes.addAll(Arrays.asList(methodCall.binding.parameters)); + for (Expression argument : arguments) { + argumentTypes.add(argument.resolvedType); + } MethodBinding fixedBinding = scope.getMethod(extensionMethod.declaringClass, methodCall.selector, argumentTypes.toArray(new TypeBinding[0]), methodCall); if (fixedBinding instanceof ProblemMethodBinding) { if (fixedBinding.declaringClass != null) { -- cgit