diff options
author | Denis Stepanov <denis.stepanov@gmail.com> | 2020-06-22 12:52:48 +0700 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-07-02 20:25:28 +0200 |
commit | e4ec9e664806612a5998bfdfa921837a43d58569 (patch) | |
tree | dbd17de9b96265984c4bd21c5bf5c5d4135d4d4e /src/core/lombok | |
parent | 326955cde1e788c0038ab77d2db340666b5f568b (diff) | |
download | lombok-e4ec9e664806612a5998bfdfa921837a43d58569.tar.gz lombok-e4ec9e664806612a5998bfdfa921837a43d58569.tar.bz2 lombok-e4ec9e664806612a5998bfdfa921837a43d58569.zip |
Fix missing parameter names, annotations in following annotation processors
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 18 |
1 files changed, 15 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); } |