Skip to content

Commit

Permalink
fix(role): CtTypeAccess getTypeAccess uses CtRole.TYPE_ACCESS
Browse files Browse the repository at this point in the history
  • Loading branch information
pvojtechovsky committed Oct 22, 2017
1 parent 8084760 commit df60e10
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/spoon/reflect/code/CtTypeAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import spoon.support.DerivedProperty;
import spoon.support.UnsettableProperty;

import static spoon.reflect.path.CtRole.TYPE;
import static spoon.reflect.path.CtRole.TYPE_ACCESS;

/**
* This code element represents a type reference usable as an expression.
Expand Down Expand Up @@ -59,7 +59,7 @@ public interface CtTypeAccess<A> extends CtExpression<Void> {
*
* @return CtTypeReference.
*/
@PropertyGetter(role = TYPE)
@PropertyGetter(role = TYPE_ACCESS)
CtTypeReference<A> getAccessedType();

/**
Expand All @@ -68,7 +68,7 @@ public interface CtTypeAccess<A> extends CtExpression<Void> {
* @param accessedType
* CtTypeReference.
*/
@PropertySetter(role = TYPE)
@PropertySetter(role = TYPE_ACCESS)
<C extends CtTypeAccess<A>> C setAccessedType(CtTypeReference<A> accessedType);

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/spoon/reflect/path/CtRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public enum CtRole {
DOCUMENTATION_TYPE,
JAVADOC_TAG_VALUE,
POSITION,
SNIPPET;
SNIPPET,
TYPE_ACCESS;

/**
* Get the {@link CtRole} associated to the field name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@
import spoon.reflect.annotations.MetamodelPropertyField;
import spoon.reflect.code.CtTypeAccess;
import spoon.reflect.declaration.CtTypedElement;
import spoon.reflect.path.CtRole;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.visitor.CtVisitor;
import spoon.support.UnsettableProperty;

import static spoon.reflect.path.CtRole.TYPE;
import static spoon.reflect.path.CtRole.TYPE_ACCESS;

public class CtTypeAccessImpl<A> extends CtExpressionImpl<Void> implements CtTypeAccess<A> {

@MetamodelPropertyField(role = CtRole.TYPE)
@MetamodelPropertyField(role = TYPE_ACCESS)
private CtTypeReference<A> type;

@Override
Expand All @@ -46,7 +45,7 @@ public <C extends CtTypeAccess<A>> C setAccessedType(CtTypeReference<A> accessed
if (accessedType != null) {
accessedType.setParent(this);
}
getFactory().getEnvironment().getModelChangeListener().onObjectUpdate(this, TYPE, accessedType, this.type);
getFactory().getEnvironment().getModelChangeListener().onObjectUpdate(this, TYPE_ACCESS, accessedType, this.type);
type = accessedType;
return (C) this;
}
Expand Down

0 comments on commit df60e10

Please sign in to comment.