diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java index 70cec819b4..b63ce5d9fb 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractAnyTypeDeclaration.java @@ -11,11 +11,9 @@ import net.sourceforge.pmd.lang.java.typeresolution.typedefinition.JavaTypeDefin /** * Abstract class for type declarations nodes. */ -abstract class AbstractAnyTypeDeclaration extends AbstractJavaNode implements ASTAnyTypeDeclaration, LeftRecursiveNode { +abstract class AbstractAnyTypeDeclaration extends AbstractJavaTypeNode implements ASTAnyTypeDeclaration, LeftRecursiveNode { private JavaTypeQualifiedName qualifiedName; - private JavaTypeDefinition typeDefinition; - AbstractAnyTypeDeclaration(int i) { super(i); @@ -44,16 +42,8 @@ abstract class AbstractAnyTypeDeclaration extends AbstractJavaNode implements AS void setQualifiedName(JavaTypeQualifiedName qualifiedName) { this.qualifiedName = qualifiedName; - this.typeDefinition = JavaTypeDefinition.forClass(qualifiedName.getType()); + setTypeDefinition(JavaTypeDefinition.forClass(qualifiedName.getType())); } - void setTypeDefinition(JavaTypeDefinition typeDefinition) { - this.typeDefinition = typeDefinition; - } - - @Override - public JavaTypeDefinition getTypeDefinition() { - return typeDefinition; - } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalApiBridge.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalApiBridge.java index 16f7763262..d249d1138d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalApiBridge.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalApiBridge.java @@ -55,8 +55,6 @@ public final class InternalApiBridge { public static void setTypeDefinition(TypeNode node, JavaTypeDefinition definition) { if (node instanceof AbstractJavaTypeNode) { ((AbstractJavaTypeNode) node).setTypeDefinition(definition); - } else if (node instanceof AbstractAnyTypeDeclaration) { - ((AbstractAnyTypeDeclaration) node).setTypeDefinition(definition); } }