|
24 | 24 | import static lombok.eclipse.handlers.EclipseHandlerUtil.createAnnotation;
|
25 | 25 |
|
26 | 26 | import java.lang.ref.WeakReference;
|
| 27 | +import java.lang.reflect.Field; |
27 | 28 | import java.lang.reflect.InvocationTargetException;
|
28 | 29 | import java.lang.reflect.Method;
|
29 | 30 | import java.util.ArrayList;
|
|
39 | 40 | import lombok.eclipse.TransformEclipseAST;
|
40 | 41 | import lombok.eclipse.handlers.EclipseHandlerUtil;
|
41 | 42 | import lombok.experimental.ExtensionMethod;
|
| 43 | +import lombok.permit.Permit; |
42 | 44 |
|
43 | 45 | import org.eclipse.jdt.internal.compiler.ast.ASTNode;
|
44 | 46 | import org.eclipse.jdt.internal.compiler.ast.Annotation;
|
@@ -293,6 +295,13 @@ public static TypeBinding resolveType(TypeBinding resolvedType, MessageSend meth
|
293 | 295 | methodCall.actualReceiverType = extensionMethod.declaringClass;
|
294 | 296 | methodCall.binding = fixedBinding;
|
295 | 297 | methodCall.resolvedType = methodCall.binding.returnType;
|
| 298 | + if (Reflection.argumentTypes != null) { |
| 299 | + try { |
| 300 | + Reflection.argumentTypes.set(methodCall, argumentTypes.toArray(new TypeBinding[0])); |
| 301 | + } catch (IllegalAccessException ignore) { |
| 302 | + // ignore |
| 303 | + } |
| 304 | + } |
296 | 305 | }
|
297 | 306 | return methodCall.resolvedType;
|
298 | 307 | }
|
@@ -329,4 +338,18 @@ private static NameReference createNameRef(TypeBinding typeBinding, ASTNode sour
|
329 | 338 | return new QualifiedNameReference(sources, poss, source.sourceStart, source.sourceEnd);
|
330 | 339 | }
|
331 | 340 | }
|
| 341 | + |
| 342 | + private static final class Reflection { |
| 343 | + public static final Field argumentTypes; |
| 344 | + |
| 345 | + static { |
| 346 | + Field a = null; |
| 347 | + try { |
| 348 | + a = Permit.getField(MessageSend.class, "argumentTypes"); |
| 349 | + } catch (Throwable t) { |
| 350 | + //ignore - old eclipse versions don't know this one |
| 351 | + } |
| 352 | + argumentTypes = a; |
| 353 | + } |
| 354 | + } |
332 | 355 | }
|
0 commit comments