diff options
Diffstat (limited to 'javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java')
-rw-r--r-- | javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java index 66ba934cf..e5b88e1a1 100644 --- a/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java +++ b/javaparser-core/src/main/java/com/github/javaparser/ast/visitor/CloneVisitor.java @@ -185,11 +185,12 @@ public class CloneVisitor implements GenericVisitor<Visitable, Object> { BlockStmt body = cloneNode(n.getBody(), arg); SimpleName name = cloneNode(n.getName(), arg); NodeList<Parameter> parameters = cloneList(n.getParameters(), arg); + ReceiverParameter receiverParameter = cloneNode(n.getReceiverParameter(), arg); NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg); NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg); NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); - ConstructorDeclaration r = new ConstructorDeclaration(n.getTokenRange().orElse(null), n.getModifiers(), annotations, typeParameters, name, parameters, thrownExceptions, body, null); + ConstructorDeclaration r = new ConstructorDeclaration(n.getTokenRange().orElse(null), n.getModifiers(), annotations, typeParameters, name, parameters, thrownExceptions, body, receiverParameter); r.setComment(comment); return r; } @@ -201,11 +202,12 @@ public class CloneVisitor implements GenericVisitor<Visitable, Object> { Type type = cloneNode(n.getType(), arg); SimpleName name = cloneNode(n.getName(), arg); NodeList<Parameter> parameters = cloneList(n.getParameters(), arg); + ReceiverParameter receiverParameter = cloneNode(n.getReceiverParameter(), arg); NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg); NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg); NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg); Comment comment = cloneNode(n.getComment(), arg); - MethodDeclaration r = new MethodDeclaration(n.getTokenRange().orElse(null), n.getModifiers(), annotations, typeParameters, type, name, parameters, thrownExceptions, body, null); + MethodDeclaration r = new MethodDeclaration(n.getTokenRange().orElse(null), n.getModifiers(), annotations, typeParameters, type, name, parameters, thrownExceptions, body, receiverParameter); r.setComment(comment); return r; } @@ -1054,4 +1056,16 @@ public class CloneVisitor implements GenericVisitor<Visitable, Object> { r.setComment(comment); return r; } + + @Override + @Generated("com.github.javaparser.generator.core.visitor.CloneVisitorGenerator") + public Visitable visit(final ReceiverParameter n, final Object arg) { + NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg); + Name name = cloneNode(n.getName(), arg); + Type type = cloneNode(n.getType(), arg); + Comment comment = cloneNode(n.getComment(), arg); + ReceiverParameter r = new ReceiverParameter(n.getTokenRange().orElse(null), annotations, type, name); + r.setComment(comment); + return r; + } } |