Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
matozoid committed May 1, 2019
1 parent dbbd907 commit 45c415d
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
Expand Up @@ -91,7 +91,7 @@ public SuperExpr setTypeName(final Name typeName) {
if (typeName == this.typeName) {
return (SuperExpr) this;
}
notifyPropertyChange(ObservableProperty.CLASS_NAME, this.typeName, typeName);
notifyPropertyChange(ObservableProperty.TYPE_NAME, this.typeName, typeName);
if (this.typeName != null)
this.typeName.setParentNode(null);
this.typeName = typeName;
Expand All @@ -106,7 +106,7 @@ public boolean remove(Node node) {
return false;
if (typeName != null) {
if (node == typeName) {
removeClassName();
removeTypeName();
return true;
}
}
Expand Down Expand Up @@ -166,4 +166,8 @@ public boolean replace(Node node, Node replacementNode) {
}
return super.replace(node, replacementNode);
}

public SuperExpr removeTypeName() {
return setTypeName((Name) null);
}
}
Expand Up @@ -93,7 +93,7 @@ public ThisExpr setTypeName(final Name typeName) {
if (typeName == this.typeName) {
return (ThisExpr) this;
}
notifyPropertyChange(ObservableProperty.CLASS_NAME, this.typeName, typeName);
notifyPropertyChange(ObservableProperty.TYPE_NAME, this.typeName, typeName);
if (this.typeName != null)
this.typeName.setParentNode(null);
this.typeName = typeName;
Expand All @@ -108,7 +108,7 @@ public boolean remove(Node node) {
return false;
if (typeName != null) {
if (node == typeName) {
removeClassName();
removeTypeName();
return true;
}
}
Expand Down Expand Up @@ -173,4 +173,8 @@ public ResolvedTypeDeclaration resolve() {
public Optional<ThisExpr> toThisExpr() {
return Optional.of(this);
}

public ThisExpr removeTypeName() {
return setTypeName((Name) null);
}
}
Expand Up @@ -44,7 +44,6 @@ public enum ObservableProperty {
CHECK(Type.SINGLE_REFERENCE),
CLASS_BODY(Type.MULTIPLE_REFERENCE),
CLASS_DECLARATION(Type.SINGLE_REFERENCE),
CLASS_NAME(Type.SINGLE_REFERENCE),
COMMENT(Type.SINGLE_REFERENCE),
COMPARE(Type.SINGLE_REFERENCE),
COMPONENT_TYPE(Type.SINGLE_REFERENCE),
Expand Down Expand Up @@ -111,6 +110,7 @@ public enum ObservableProperty {
TYPES(Type.MULTIPLE_REFERENCE),
TYPE_ARGUMENTS(Type.MULTIPLE_REFERENCE),
TYPE_BOUND(Type.MULTIPLE_REFERENCE),
TYPE_NAME(Type.SINGLE_REFERENCE),
TYPE_PARAMETERS(Type.MULTIPLE_REFERENCE),
UPDATE(Type.MULTIPLE_REFERENCE),
VALUE(Type.SINGLE_REFERENCE),
Expand Down
Expand Up @@ -598,19 +598,19 @@ public Visitable visit(final SimpleName n, final Object arg) {

@Override
public Visitable visit(final ThisExpr n, final Object arg) {
Name className = cloneNode(n.getTypeName(), arg);
Name typeName = cloneNode(n.getTypeName(), arg);
Comment comment = cloneNode(n.getComment(), arg);
ThisExpr r = new ThisExpr(n.getTokenRange().orElse(null), className);
ThisExpr r = new ThisExpr(n.getTokenRange().orElse(null), typeName);
r.setComment(comment);
copyData(n, r);
return r;
}

@Override
public Visitable visit(final SuperExpr n, final Object arg) {
Name className = cloneNode(n.getTypeName(), arg);
Name typeName = cloneNode(n.getTypeName(), arg);
Comment comment = cloneNode(n.getComment(), arg);
SuperExpr r = new SuperExpr(n.getTokenRange().orElse(null), className);
SuperExpr r = new SuperExpr(n.getTokenRange().orElse(null), typeName);
r.setComment(comment);
copyData(n, r);
return r;
Expand Down
Expand Up @@ -830,9 +830,9 @@ public Visitable visit(final StringLiteralExpr n, final A arg) {

@Override
public Visitable visit(final SuperExpr n, final A arg) {
Name className = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null);
Name typeName = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null);
Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null);
n.setTypeName(className);
n.setTypeName(typeName);
n.setComment(comment);
return n;
}
Expand Down Expand Up @@ -876,9 +876,9 @@ public Visitable visit(final SynchronizedStmt n, final A arg) {

@Override
public Visitable visit(final ThisExpr n, final A arg) {
Name className = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null);
Name typeName = n.getTypeName().map(s -> (Name) s.accept(this, arg)).orElse(null);
Comment comment = n.getComment().map(s -> (Comment) s.accept(this, arg)).orElse(null);
n.setTypeName(className);
n.setTypeName(typeName);
n.setComment(comment);
return n;
}
Expand Down
Expand Up @@ -162,8 +162,8 @@ private static void initializeConstructorParameters() {
simpleNameMetaModel.getConstructorParameters().add(simpleNameMetaModel.identifierPropertyMetaModel);
singleMemberAnnotationExprMetaModel.getConstructorParameters().add(annotationExprMetaModel.namePropertyMetaModel);
singleMemberAnnotationExprMetaModel.getConstructorParameters().add(singleMemberAnnotationExprMetaModel.memberValuePropertyMetaModel);
superExprMetaModel.getConstructorParameters().add(superExprMetaModel.classNamePropertyMetaModel);
thisExprMetaModel.getConstructorParameters().add(thisExprMetaModel.classNamePropertyMetaModel);
superExprMetaModel.getConstructorParameters().add(superExprMetaModel.typeNamePropertyMetaModel);
thisExprMetaModel.getConstructorParameters().add(thisExprMetaModel.typeNamePropertyMetaModel);
typeExprMetaModel.getConstructorParameters().add(typeExprMetaModel.typePropertyMetaModel);
unaryExprMetaModel.getConstructorParameters().add(unaryExprMetaModel.expressionPropertyMetaModel);
unaryExprMetaModel.getConstructorParameters().add(unaryExprMetaModel.operatorPropertyMetaModel);
Expand Down Expand Up @@ -587,10 +587,10 @@ private static void initializePropertyMetaModels() {
simpleNameMetaModel.getDeclaredPropertyMetaModels().add(simpleNameMetaModel.identifierPropertyMetaModel);
singleMemberAnnotationExprMetaModel.memberValuePropertyMetaModel = new PropertyMetaModel(singleMemberAnnotationExprMetaModel, "memberValue", com.github.javaparser.ast.expr.Expression.class, Optional.of(expressionMetaModel), false, false, false, false);
singleMemberAnnotationExprMetaModel.getDeclaredPropertyMetaModels().add(singleMemberAnnotationExprMetaModel.memberValuePropertyMetaModel);
superExprMetaModel.classNamePropertyMetaModel = new PropertyMetaModel(superExprMetaModel, "className", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), true, false, false, false);
superExprMetaModel.getDeclaredPropertyMetaModels().add(superExprMetaModel.classNamePropertyMetaModel);
thisExprMetaModel.classNamePropertyMetaModel = new PropertyMetaModel(thisExprMetaModel, "className", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), true, false, false, false);
thisExprMetaModel.getDeclaredPropertyMetaModels().add(thisExprMetaModel.classNamePropertyMetaModel);
superExprMetaModel.typeNamePropertyMetaModel = new PropertyMetaModel(superExprMetaModel, "typeName", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), true, false, false, false);
superExprMetaModel.getDeclaredPropertyMetaModels().add(superExprMetaModel.typeNamePropertyMetaModel);
thisExprMetaModel.typeNamePropertyMetaModel = new PropertyMetaModel(thisExprMetaModel, "typeName", com.github.javaparser.ast.expr.Name.class, Optional.of(nameMetaModel), true, false, false, false);
thisExprMetaModel.getDeclaredPropertyMetaModels().add(thisExprMetaModel.typeNamePropertyMetaModel);
typeExprMetaModel.typePropertyMetaModel = new PropertyMetaModel(typeExprMetaModel, "type", com.github.javaparser.ast.type.Type.class, Optional.of(typeMetaModel), false, false, false, false);
typeExprMetaModel.getDeclaredPropertyMetaModels().add(typeExprMetaModel.typePropertyMetaModel);
unaryExprMetaModel.expressionPropertyMetaModel = new PropertyMetaModel(unaryExprMetaModel, "expression", com.github.javaparser.ast.expr.Expression.class, Optional.of(expressionMetaModel), false, false, false, false);
Expand Down
Expand Up @@ -8,5 +8,5 @@ public class SuperExprMetaModel extends ExpressionMetaModel {
super(superBaseNodeMetaModel, com.github.javaparser.ast.expr.SuperExpr.class, "SuperExpr", "com.github.javaparser.ast.expr", false, false);
}

public PropertyMetaModel classNamePropertyMetaModel;
public PropertyMetaModel typeNamePropertyMetaModel;
}
Expand Up @@ -8,5 +8,5 @@ public class ThisExprMetaModel extends ExpressionMetaModel {
super(superBaseNodeMetaModel, com.github.javaparser.ast.expr.ThisExpr.class, "ThisExpr", "com.github.javaparser.ast.expr", false, false);
}

public PropertyMetaModel classNamePropertyMetaModel;
public PropertyMetaModel typeNamePropertyMetaModel;
}
Expand Up @@ -473,13 +473,13 @@ private static CsmElement typeArguments() {

concreteSyntaxModelByClass.put(SuperExpr.class, sequence(
comment(),
conditional(CLASS_NAME, IS_PRESENT, sequence(child(CLASS_NAME), token(GeneratedJavaParserConstants.DOT))),
conditional(TYPE_NAME, IS_PRESENT, sequence(child(TYPE_NAME), token(GeneratedJavaParserConstants.DOT))),
token(GeneratedJavaParserConstants.SUPER)
));

concreteSyntaxModelByClass.put(ThisExpr.class, sequence(
comment(),
conditional(CLASS_NAME, IS_PRESENT, sequence(child(CLASS_NAME), token(GeneratedJavaParserConstants.DOT))),
conditional(TYPE_NAME, IS_PRESENT, sequence(child(TYPE_NAME), token(GeneratedJavaParserConstants.DOT))),
token(GeneratedJavaParserConstants.THIS)
));

Expand Down

0 comments on commit 45c415d

Please sign in to comment.