Skip to content

Commit

Permalink
Regenerate code
Browse files Browse the repository at this point in the history
  • Loading branch information
matozoid committed Oct 16, 2017
1 parent 2e435be commit 255d264
Show file tree
Hide file tree
Showing 22 changed files with 364 additions and 243 deletions.
Expand Up @@ -43,7 +43,6 @@
import static com.github.javaparser.utils.Utils.assertNotNull; import static com.github.javaparser.utils.Utils.assertNotNull;
import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;

import java.util.Optional; import java.util.Optional;
import java.util.function.Consumer; import java.util.function.Consumer;


Expand Down Expand Up @@ -223,6 +222,12 @@ public boolean remove(Node node) {
return true; return true;
} }
} }
if (receiverParameter != null) {
if (node == receiverParameter) {
removeReceiverParameter();
return true;
}
}
for (int i = 0; i < thrownExceptions.size(); i++) { for (int i = 0; i < thrownExceptions.size(); i++) {
if (thrownExceptions.get(i) == node) { if (thrownExceptions.get(i) == node) {
thrownExceptions.remove(i); thrownExceptions.remove(i);
Expand Down Expand Up @@ -349,6 +354,12 @@ public boolean replace(Node node, Node replacementNode) {
return true; return true;
} }
} }
if (receiverParameter != null) {
if (node == receiverParameter) {
setReceiverParameter((ReceiverParameter) replacementNode);
return true;
}
}
for (int i = 0; i < thrownExceptions.size(); i++) { for (int i = 0; i < thrownExceptions.size(); i++) {
if (thrownExceptions.get(i) == node) { if (thrownExceptions.get(i) == node) {
thrownExceptions.set(i, (ReferenceType) replacementNode); thrownExceptions.set(i, (ReferenceType) replacementNode);
Expand Down Expand Up @@ -381,11 +392,27 @@ public void ifCallableDeclaration(Consumer<CallableDeclaration> action) {
action.accept(this); action.accept(this);
} }


@Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
public Optional<ReceiverParameter> getReceiverParameter() { public Optional<ReceiverParameter> getReceiverParameter() {
return Optional.ofNullable(receiverParameter); return Optional.ofNullable(receiverParameter);
} }


public void setReceiverParameter(ReceiverParameter receiverParameter) { @SuppressWarnings("unchecked")
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
public T setReceiverParameter(final ReceiverParameter receiverParameter) {
if (receiverParameter == this.receiverParameter) {
return (T) this;
}
notifyPropertyChange(ObservableProperty.RECEIVER_PARAMETER, this.receiverParameter, receiverParameter);
if (this.receiverParameter != null)
this.receiverParameter.setParentNode(null);
this.receiverParameter = receiverParameter; this.receiverParameter = receiverParameter;
setAsParentNodeOf(receiverParameter);
return (T) this;
}

@Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator")
public CallableDeclaration removeReceiverParameter() {
return setReceiverParameter((ReceiverParameter) null);
} }
} }
Expand Up @@ -66,7 +66,7 @@ public final class MethodDeclaration extends CallableDeclaration<MethodDeclarati
private Type type; private Type type;


private BlockStmt body; private BlockStmt body;

public MethodDeclaration() { public MethodDeclaration() {
this(null, EnumSet.noneOf(Modifier.class), new NodeList<>(), new NodeList<>(), new ClassOrInterfaceType(), new SimpleName(), new NodeList<>(), new NodeList<>(), new BlockStmt(), null); this(null, EnumSet.noneOf(Modifier.class), new NodeList<>(), new NodeList<>(), new ClassOrInterfaceType(), new SimpleName(), new NodeList<>(), new NodeList<>(), new BlockStmt(), null);
} }
Expand All @@ -80,14 +80,14 @@ public MethodDeclaration(final EnumSet<Modifier> modifiers, final String name, f
} }


@AllFieldsConstructor @AllFieldsConstructor
public MethodDeclaration(final EnumSet<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body) { public MethodDeclaration(final EnumSet<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter) {
this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, null); this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, receiverParameter);
} }


/** @deprecated this constructor allows you to set "isDefault", but this is no longer a field of this node, but simply one of the modifiers. Use setDefault(boolean) or add DEFAULT to the modifiers set. */ /** @deprecated this constructor allows you to set "isDefault", but this is no longer a field of this node, but simply one of the modifiers. Use setDefault(boolean) or add DEFAULT to the modifiers set. */
@Deprecated @Deprecated
public MethodDeclaration(final EnumSet<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final boolean isDefault, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body, ReceiverParameter receiverParameter) { public MethodDeclaration(final EnumSet<Modifier> modifiers, final NodeList<AnnotationExpr> annotations, final NodeList<TypeParameter> typeParameters, final Type type, final SimpleName name, final boolean isDefault, final NodeList<Parameter> parameters, final NodeList<ReferenceType> thrownExceptions, final BlockStmt body) {
this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, receiverParameter); this(null, modifiers, annotations, typeParameters, type, name, parameters, thrownExceptions, body, null);
setDefault(isDefault); setDefault(isDefault);
} }


Expand Down
Expand Up @@ -69,7 +69,7 @@ public final class Parameter extends Node implements NodeWithType<Parameter, Typ
private NodeList<AnnotationExpr> annotations; private NodeList<AnnotationExpr> annotations;


private SimpleName name; private SimpleName name;

public Parameter() { public Parameter() {
this(null, EnumSet.noneOf(Modifier.class), new NodeList<>(), new ClassOrInterfaceType(), false, new NodeList<>(), new SimpleName()); this(null, EnumSet.noneOf(Modifier.class), new NodeList<>(), new ClassOrInterfaceType(), false, new NodeList<>(), new SimpleName());
} }
Expand Down
Expand Up @@ -41,11 +41,10 @@
import com.github.javaparser.ast.visitor.VoidVisitor; import com.github.javaparser.ast.visitor.VoidVisitor;
import com.github.javaparser.metamodel.JavaParserMetaModel; import com.github.javaparser.metamodel.JavaParserMetaModel;
import com.github.javaparser.metamodel.ParameterMetaModel; import com.github.javaparser.metamodel.ParameterMetaModel;

import javax.annotation.Generated; import javax.annotation.Generated;
import java.util.EnumSet; import java.util.EnumSet;

import static com.github.javaparser.utils.Utils.assertNotNull; import static com.github.javaparser.utils.Utils.assertNotNull;
import com.github.javaparser.metamodel.ReceiverParameterMetaModel;


/** /**
* The rather obscure <a href="http://blog.joda.org/2015/12/explicit-receiver-parameters.html">"receiver parameter" feature of Java</a>. * The rather obscure <a href="http://blog.joda.org/2015/12/explicit-receiver-parameters.html">"receiver parameter" feature of Java</a>.
Expand All @@ -62,7 +61,7 @@ public final class ReceiverParameter extends Node implements NodeWithType<Receiv
private NodeList<AnnotationExpr> annotations; private NodeList<AnnotationExpr> annotations;


private Name name; private Name name;

public ReceiverParameter() { public ReceiverParameter() {
this(null, new NodeList<>(), new ClassOrInterfaceType(), new Name()); this(null, new NodeList<>(), new ClassOrInterfaceType(), new Name());
} }
Expand Down Expand Up @@ -103,7 +102,6 @@ public <R, A> R accept(GenericVisitor<R, A> v, A arg) {


@Override @Override
public <A> void accept(VoidVisitor<A> v, A arg) { public <A> void accept(VoidVisitor<A> v, A arg) {

} }


@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
Expand Down Expand Up @@ -150,7 +148,7 @@ public ReceiverParameter setAnnotations(final NodeList<AnnotationExpr> annotatio
setAsParentNodeOf(annotations); setAsParentNodeOf(annotations);
return this; return this;
} }

@Override @Override
@Generated("com.github.javaparser.generator.core.node.CloneGenerator") @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
public ReceiverParameter clone() { public ReceiverParameter clone() {
Expand All @@ -159,18 +157,62 @@ public ReceiverParameter clone() {


@Override @Override
@Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator") @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
public ParameterMetaModel getMetaModel() { public ReceiverParameterMetaModel getMetaModel() {
return JavaParserMetaModel.parameterMetaModel; return JavaParserMetaModel.receiverParameterMetaModel;
} }


@Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
public Name getName() { public Name getName() {
return name; return name;
} }


@Override @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
public ReceiverParameter setName(Name name) { public ReceiverParameter setName(final Name name) {
this.name=name; assertNotNull(name);
if (name == this.name) {
return (ReceiverParameter) this;
}
notifyPropertyChange(ObservableProperty.NAME, this.name, name);
if (this.name != null)
this.name.setParentNode(null);
this.name = name;
setAsParentNodeOf(name);
return this; return this;
} }

@Override
@Generated("com.github.javaparser.generator.core.node.RemoveMethodGenerator")
public boolean remove(Node node) {
if (node == null)
return false;
for (int i = 0; i < annotations.size(); i++) {
if (annotations.get(i) == node) {
annotations.remove(i);
return true;
}
}
return super.remove(node);
}

@Override
@Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator")
public boolean replace(Node node, Node replacementNode) {
if (node == null)
return false;
for (int i = 0; i < annotations.size(); i++) {
if (annotations.get(i) == node) {
annotations.set(i, (AnnotationExpr) replacementNode);
return true;
}
}
if (node == name) {
setName((Name) replacementNode);
return true;
}
if (node == type) {
setType((Type) replacementNode);
return true;
}
return super.replace(node, replacementNode);
}
} }
Expand Up @@ -35,7 +35,7 @@
@Generated("com.github.javaparser.generator.core.node.PropertyGenerator") @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
public enum ObservableProperty { public enum ObservableProperty {


ANNOTATIONS(Type.MULTIPLE_REFERENCE), ANONYMOUS_CLASS_BODY(Type.MULTIPLE_REFERENCE), ARGUMENTS(Type.MULTIPLE_REFERENCE), ASTERISK(Type.SINGLE_ATTRIBUTE), BODY(Type.SINGLE_REFERENCE), CATCH_CLAUSES(Type.MULTIPLE_REFERENCE), CHECK(Type.SINGLE_REFERENCE), CLASS_BODY(Type.MULTIPLE_REFERENCE), CLASS_DECLARATION(Type.SINGLE_REFERENCE), CLASS_EXPR(Type.SINGLE_REFERENCE), COMMENT(Type.SINGLE_REFERENCE), COMPARE(Type.SINGLE_REFERENCE), COMPONENT_TYPE(Type.SINGLE_REFERENCE), CONDITION(Type.SINGLE_REFERENCE), CONTENT(Type.SINGLE_ATTRIBUTE), DEFAULT_VALUE(Type.SINGLE_REFERENCE), DIMENSION(Type.SINGLE_REFERENCE), ELEMENTS(Type.MULTIPLE_REFERENCE), ELEMENT_TYPE(Type.SINGLE_REFERENCE), ELSE_EXPR(Type.SINGLE_REFERENCE), ELSE_STMT(Type.SINGLE_REFERENCE), ENCLOSING_PARAMETERS(Type.SINGLE_ATTRIBUTE), ENTRIES(Type.MULTIPLE_REFERENCE), EXPRESSION(Type.SINGLE_REFERENCE), EXTENDED_TYPE(Type.SINGLE_REFERENCE), EXTENDED_TYPES(Type.MULTIPLE_REFERENCE), FINALLY_BLOCK(Type.SINGLE_REFERENCE), IDENTIFIER(Type.SINGLE_ATTRIBUTE), IMPLEMENTED_TYPES(Type.MULTIPLE_REFERENCE), IMPORTS(Type.MULTIPLE_REFERENCE), INDEX(Type.SINGLE_REFERENCE), INITIALIZATION(Type.MULTIPLE_REFERENCE), INITIALIZER(Type.SINGLE_REFERENCE), INNER(Type.SINGLE_REFERENCE), INTERFACE(Type.SINGLE_ATTRIBUTE), ITERABLE(Type.SINGLE_REFERENCE), LABEL(Type.SINGLE_REFERENCE), LEFT(Type.SINGLE_REFERENCE), LEVELS(Type.MULTIPLE_REFERENCE), MEMBERS(Type.MULTIPLE_REFERENCE), MEMBER_VALUE(Type.SINGLE_REFERENCE), MESSAGE(Type.SINGLE_REFERENCE), MODIFIERS(Type.MULTIPLE_ATTRIBUTE), MODULE(Type.SINGLE_REFERENCE), MODULE_NAMES(Type.MULTIPLE_REFERENCE), MODULE_STMTS(Type.MULTIPLE_REFERENCE), NAME(Type.SINGLE_REFERENCE), OPEN(Type.SINGLE_ATTRIBUTE), OPERATOR(Type.SINGLE_ATTRIBUTE), ORIGIN(Type.SINGLE_ATTRIBUTE), PACKAGE_DECLARATION(Type.SINGLE_REFERENCE), PAIRS(Type.MULTIPLE_REFERENCE), PARAMETER(Type.SINGLE_REFERENCE), PARAMETERS(Type.MULTIPLE_REFERENCE), QUALIFIER(Type.SINGLE_REFERENCE), RESOURCES(Type.MULTIPLE_REFERENCE), RIGHT(Type.SINGLE_REFERENCE), SCOPE(Type.SINGLE_REFERENCE), SELECTOR(Type.SINGLE_REFERENCE), STATEMENT(Type.SINGLE_REFERENCE), STATEMENTS(Type.MULTIPLE_REFERENCE), STATIC(Type.SINGLE_ATTRIBUTE), SUPER_TYPE(Type.SINGLE_REFERENCE), TARGET(Type.SINGLE_REFERENCE), THEN_EXPR(Type.SINGLE_REFERENCE), THEN_STMT(Type.SINGLE_REFERENCE), THIS(Type.SINGLE_ATTRIBUTE), THROWN_EXCEPTIONS(Type.MULTIPLE_REFERENCE), TRY_BLOCK(Type.SINGLE_REFERENCE), TYPE(Type.SINGLE_REFERENCE), TYPES(Type.MULTIPLE_REFERENCE), TYPE_ARGUMENTS(Type.MULTIPLE_REFERENCE), TYPE_BOUND(Type.MULTIPLE_REFERENCE), TYPE_PARAMETERS(Type.MULTIPLE_REFERENCE), UPDATE(Type.MULTIPLE_REFERENCE), VALUE(Type.SINGLE_REFERENCE), VALUES(Type.MULTIPLE_REFERENCE), VARIABLE(Type.SINGLE_REFERENCE), VARIABLES(Type.MULTIPLE_REFERENCE), VAR_ARGS(Type.SINGLE_ATTRIBUTE), VAR_ARGS_ANNOTATIONS(Type.MULTIPLE_REFERENCE), WITH_TYPES(Type.MULTIPLE_REFERENCE), ELSE_BLOCK(Type.SINGLE_ATTRIBUTE, true), EXPRESSION_BODY(Type.SINGLE_REFERENCE, true), MAXIMUM_COMMON_TYPE(Type.SINGLE_REFERENCE, true), POSTFIX(Type.SINGLE_ATTRIBUTE, true), PREFIX(Type.SINGLE_ATTRIBUTE, true), THEN_BLOCK(Type.SINGLE_ATTRIBUTE, true), USING_DIAMOND_OPERATOR(Type.SINGLE_ATTRIBUTE, true), RANGE, COMMENTED_NODE; ANNOTATIONS(Type.MULTIPLE_REFERENCE), ANONYMOUS_CLASS_BODY(Type.MULTIPLE_REFERENCE), ARGUMENTS(Type.MULTIPLE_REFERENCE), ASTERISK(Type.SINGLE_ATTRIBUTE), BODY(Type.SINGLE_REFERENCE), CATCH_CLAUSES(Type.MULTIPLE_REFERENCE), CHECK(Type.SINGLE_REFERENCE), CLASS_BODY(Type.MULTIPLE_REFERENCE), CLASS_DECLARATION(Type.SINGLE_REFERENCE), CLASS_EXPR(Type.SINGLE_REFERENCE), COMMENT(Type.SINGLE_REFERENCE), COMPARE(Type.SINGLE_REFERENCE), COMPONENT_TYPE(Type.SINGLE_REFERENCE), CONDITION(Type.SINGLE_REFERENCE), CONTENT(Type.SINGLE_ATTRIBUTE), DEFAULT_VALUE(Type.SINGLE_REFERENCE), DIMENSION(Type.SINGLE_REFERENCE), ELEMENTS(Type.MULTIPLE_REFERENCE), ELEMENT_TYPE(Type.SINGLE_REFERENCE), ELSE_EXPR(Type.SINGLE_REFERENCE), ELSE_STMT(Type.SINGLE_REFERENCE), ENCLOSING_PARAMETERS(Type.SINGLE_ATTRIBUTE), ENTRIES(Type.MULTIPLE_REFERENCE), EXPRESSION(Type.SINGLE_REFERENCE), EXTENDED_TYPE(Type.SINGLE_REFERENCE), EXTENDED_TYPES(Type.MULTIPLE_REFERENCE), FINALLY_BLOCK(Type.SINGLE_REFERENCE), IDENTIFIER(Type.SINGLE_ATTRIBUTE), IMPLEMENTED_TYPES(Type.MULTIPLE_REFERENCE), IMPORTS(Type.MULTIPLE_REFERENCE), INDEX(Type.SINGLE_REFERENCE), INITIALIZATION(Type.MULTIPLE_REFERENCE), INITIALIZER(Type.SINGLE_REFERENCE), INNER(Type.SINGLE_REFERENCE), INTERFACE(Type.SINGLE_ATTRIBUTE), ITERABLE(Type.SINGLE_REFERENCE), LABEL(Type.SINGLE_REFERENCE), LEFT(Type.SINGLE_REFERENCE), LEVELS(Type.MULTIPLE_REFERENCE), MEMBERS(Type.MULTIPLE_REFERENCE), MEMBER_VALUE(Type.SINGLE_REFERENCE), MESSAGE(Type.SINGLE_REFERENCE), MODIFIERS(Type.MULTIPLE_ATTRIBUTE), MODULE(Type.SINGLE_REFERENCE), MODULE_NAMES(Type.MULTIPLE_REFERENCE), MODULE_STMTS(Type.MULTIPLE_REFERENCE), NAME(Type.SINGLE_REFERENCE), OPEN(Type.SINGLE_ATTRIBUTE), OPERATOR(Type.SINGLE_ATTRIBUTE), ORIGIN(Type.SINGLE_ATTRIBUTE), PACKAGE_DECLARATION(Type.SINGLE_REFERENCE), PAIRS(Type.MULTIPLE_REFERENCE), PARAMETER(Type.SINGLE_REFERENCE), PARAMETERS(Type.MULTIPLE_REFERENCE), QUALIFIER(Type.SINGLE_REFERENCE), RECEIVER_PARAMETER(Type.SINGLE_REFERENCE), RESOURCES(Type.MULTIPLE_REFERENCE), RIGHT(Type.SINGLE_REFERENCE), SCOPE(Type.SINGLE_REFERENCE), SELECTOR(Type.SINGLE_REFERENCE), STATEMENT(Type.SINGLE_REFERENCE), STATEMENTS(Type.MULTIPLE_REFERENCE), STATIC(Type.SINGLE_ATTRIBUTE), SUPER_TYPE(Type.SINGLE_REFERENCE), TARGET(Type.SINGLE_REFERENCE), THEN_EXPR(Type.SINGLE_REFERENCE), THEN_STMT(Type.SINGLE_REFERENCE), THIS(Type.SINGLE_ATTRIBUTE), THROWN_EXCEPTIONS(Type.MULTIPLE_REFERENCE), TRY_BLOCK(Type.SINGLE_REFERENCE), TYPE(Type.SINGLE_REFERENCE), TYPES(Type.MULTIPLE_REFERENCE), TYPE_ARGUMENTS(Type.MULTIPLE_REFERENCE), TYPE_BOUND(Type.MULTIPLE_REFERENCE), TYPE_PARAMETERS(Type.MULTIPLE_REFERENCE), UPDATE(Type.MULTIPLE_REFERENCE), VALUE(Type.SINGLE_REFERENCE), VALUES(Type.MULTIPLE_REFERENCE), VARIABLE(Type.SINGLE_REFERENCE), VARIABLES(Type.MULTIPLE_REFERENCE), VAR_ARGS(Type.SINGLE_ATTRIBUTE), VAR_ARGS_ANNOTATIONS(Type.MULTIPLE_REFERENCE), WITH_TYPES(Type.MULTIPLE_REFERENCE), ELSE_BLOCK(Type.SINGLE_ATTRIBUTE, true), EXPRESSION_BODY(Type.SINGLE_REFERENCE, true), MAXIMUM_COMMON_TYPE(Type.SINGLE_REFERENCE, true), POSTFIX(Type.SINGLE_ATTRIBUTE, true), PREFIX(Type.SINGLE_ATTRIBUTE, true), THEN_BLOCK(Type.SINGLE_ATTRIBUTE, true), USING_DIAMOND_OPERATOR(Type.SINGLE_ATTRIBUTE, true), RANGE, COMMENTED_NODE;


enum Type { enum Type {


Expand Down
Expand Up @@ -185,11 +185,12 @@ public Visitable visit(final ConstructorDeclaration n, final Object arg) {
BlockStmt body = cloneNode(n.getBody(), arg); BlockStmt body = cloneNode(n.getBody(), arg);
SimpleName name = cloneNode(n.getName(), arg); SimpleName name = cloneNode(n.getName(), arg);
NodeList<Parameter> parameters = cloneList(n.getParameters(), arg); NodeList<Parameter> parameters = cloneList(n.getParameters(), arg);
ReceiverParameter receiverParameter = cloneNode(n.getReceiverParameter(), arg);
NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg); NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg);
NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg); NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg);
NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg); NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg);
Comment comment = cloneNode(n.getComment(), 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); r.setComment(comment);
return r; return r;
} }
Expand All @@ -201,11 +202,12 @@ public Visitable visit(final MethodDeclaration n, final Object arg) {
Type type = cloneNode(n.getType(), arg); Type type = cloneNode(n.getType(), arg);
SimpleName name = cloneNode(n.getName(), arg); SimpleName name = cloneNode(n.getName(), arg);
NodeList<Parameter> parameters = cloneList(n.getParameters(), arg); NodeList<Parameter> parameters = cloneList(n.getParameters(), arg);
ReceiverParameter receiverParameter = cloneNode(n.getReceiverParameter(), arg);
NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg); NodeList<ReferenceType> thrownExceptions = cloneList(n.getThrownExceptions(), arg);
NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg); NodeList<TypeParameter> typeParameters = cloneList(n.getTypeParameters(), arg);
NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg); NodeList<AnnotationExpr> annotations = cloneList(n.getAnnotations(), arg);
Comment comment = cloneNode(n.getComment(), 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); r.setComment(comment);
return r; return r;
} }
Expand Down Expand Up @@ -1054,4 +1056,16 @@ public Visitable visit(final UnparsableStmt n, final Object arg) {
r.setComment(comment); r.setComment(comment);
return r; 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;
}
} }

0 comments on commit 255d264

Please sign in to comment.