aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Stepanov <denis.stepanov@gmail.com>2020-06-22 12:52:48 +0700
committerRoel Spilker <r.spilker@gmail.com>2020-07-02 20:25:28 +0200
commite4ec9e664806612a5998bfdfa921837a43d58569 (patch)
treedbd17de9b96265984c4bd21c5bf5c5d4135d4d4e /src
parent326955cde1e788c0038ab77d2db340666b5f568b (diff)
downloadlombok-e4ec9e664806612a5998bfdfa921837a43d58569.tar.gz
lombok-e4ec9e664806612a5998bfdfa921837a43d58569.tar.bz2
lombok-e4ec9e664806612a5998bfdfa921837a43d58569.zip
Fix missing parameter names, annotations in following annotation processors
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java18
-rw-r--r--src/stubs/com/sun/tools/javac/code/Symbol.java2
2 files changed, 17 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 5241a209..e0f6276f 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -1200,16 +1200,28 @@ public class JavacHandlerUtil {
addSuppressWarningsAll(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext());
addGenerated(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext());
type.defs = type.defs.append(method);
-
- fixMethodMirror(typeNode.getContext(), typeNode.getElement(), method.getModifiers().flags, method.getName(), paramTypes, returnType);
+
+ List<Symbol.VarSymbol> params = null;
+ if (method.getParameters() != null && !method.getParameters().isEmpty()) {
+ ListBuffer<Symbol.VarSymbol> newParams = new ListBuffer<Symbol.VarSymbol>();
+ for (JCTree.JCVariableDecl param : method.getParameters()) {
+ newParams.append(param.sym);
+ }
+ params = newParams.toList();
+ }
+
+ fixMethodMirror(typeNode.getContext(), typeNode.getElement(), method.getModifiers().flags, method.getName(), paramTypes, params, returnType);
typeNode.add(method, Kind.METHOD);
}
- private static void fixMethodMirror(Context context, Element typeMirror, long access, Name methodName, List<Type> paramTypes, Type returnType) {
+ private static void fixMethodMirror(Context context, Element typeMirror, long access, Name methodName, List<Type> paramTypes, List<Symbol.VarSymbol> params, Type returnType) {
if (typeMirror == null || paramTypes == null || returnType == null) return;
ClassSymbol cs = (ClassSymbol) typeMirror;
MethodSymbol methodSymbol = new MethodSymbol(access, methodName, new MethodType(paramTypes, returnType, List.<Type>nil(), Symtab.instance(context).methodClass), cs);
+ if (params != null && !params.isEmpty()) {
+ methodSymbol.params = params;
+ }
ClassSymbolMembersField.enter(cs, methodSymbol);
}
diff --git a/src/stubs/com/sun/tools/javac/code/Symbol.java b/src/stubs/com/sun/tools/javac/code/Symbol.java
index 4aef63ad..7324cb8e 100644
--- a/src/stubs/com/sun/tools/javac/code/Symbol.java
+++ b/src/stubs/com/sun/tools/javac/code/Symbol.java
@@ -18,6 +18,7 @@ import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeMirror;
+import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Name;
public abstract class Symbol implements Element {
@@ -41,6 +42,7 @@ public abstract class Symbol implements Element {
public static abstract class TypeSymbol extends Symbol {}
public static class MethodSymbol extends Symbol implements ExecutableElement {
+ public List<Symbol.VarSymbol> params = null;
public MethodSymbol(long flags, Name name, Type type, Symbol owner) {}
@Override public ElementKind getKind() { return null; }
@Override public Set<Modifier> getModifiers() { return null; }