|
19 | 19 | import org.eclipse.jdt.core.dom.ASTNode; |
20 | 20 | import org.eclipse.jdt.core.dom.FieldDeclaration; |
21 | 21 | import org.eclipse.jdt.core.dom.IBinding; |
22 | | -import org.eclipse.jdt.core.dom.ITypeBinding; |
23 | 22 | import org.eclipse.jdt.core.dom.LambdaExpression; |
24 | 23 | import org.eclipse.jdt.core.dom.MethodDeclaration; |
25 | 24 | import org.eclipse.jdt.core.dom.Modifier; |
26 | 25 | import org.eclipse.jdt.core.dom.VariableDeclarationFragment; |
| 26 | +import org.eclipse.jdt.internal.SignatureUtils; |
27 | 27 | import org.eclipse.jdt.internal.core.JavaElement; |
28 | 28 | import org.eclipse.jdt.internal.core.LambdaFactory; |
29 | 29 |
|
@@ -74,7 +74,7 @@ public IMethod getJavaElement() { |
74 | 74 | int arrowIndex = ((List<ASTNode>)this.declaration.parameters()).stream().mapToInt(param -> param.getStartPosition() + param.getLength()).max().orElse(this.declaration.getStartPosition()); |
75 | 75 | org.eclipse.jdt.internal.core.LambdaExpression expr = LambdaFactory.createLambdaExpression(parent, Signature.createTypeSignature(getMethodDeclaration().getDeclaringClass().getQualifiedName(), true), this.declaration.getStartPosition(), this.declaration.getStartPosition() + this.declaration.getLength() - 1, arrowIndex); |
76 | 76 | String returnTypeName = getReturnType().getName(); |
77 | | - return LambdaFactory.createLambdaMethod(expr, this.methodSymbol.name.toString(), getKey(), this.declaration.getStartPosition(), this.declaration.getStartPosition() + this.declaration.getLength() - 1, arrowIndex, Arrays.stream(getParameterTypes()).map(ITypeBinding::getName).toArray(String[]::new), getParameterNames(), Signature.createTypeSignature(returnTypeName.isEmpty() ? Object.class.getName() : returnTypeName, true)); |
| 77 | + return LambdaFactory.createLambdaMethod(expr, this.methodSymbol.name.toString(), getKey(), this.declaration.getStartPosition(), this.declaration.getStartPosition() + this.declaration.getLength() - 1, arrowIndex, Arrays.stream(getParameterTypes()).map(SignatureUtils::getSignature).toArray(String[]::new), getParameterNames(), Signature.createTypeSignature(returnTypeName.isEmpty() ? Object.class.getName() : returnTypeName, true)); |
78 | 78 | } |
79 | 79 | return super.getJavaElement(); |
80 | 80 | } |
|
0 commit comments