diff options
-rwxr-xr-x | AUTHORS | 1 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 18 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/code/Symbol.java | 2 |
3 files changed, 18 insertions, 3 deletions
@@ -9,6 +9,7 @@ Christian Sterzl <christian.sterzl@gmail.com> DaveLaw <project.lombok@apconsult.de> Dave Brosius <dbrosius@mebigfatguy.com> Dawid Rusin <dawidrusin90@gmail.com> +Denis Stepanov <denis.stepanov@gmail.com> Emil Lundberg <emil@yubico.com> Enrique da Costa Cambio <enrique.dacostacambio@gmail.com> Jacob Middag <jacob@gaddim.nl> 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; } |