Make AbstractAnyTypeDeclaration extend AbstractJavaTypeNode
This commit is contained in:
@ -11,11 +11,9 @@ import net.sourceforge.pmd.lang.java.typeresolution.typedefinition.JavaTypeDefin
|
|||||||
/**
|
/**
|
||||||
* Abstract class for type declarations nodes.
|
* 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 JavaTypeQualifiedName qualifiedName;
|
||||||
private JavaTypeDefinition typeDefinition;
|
|
||||||
|
|
||||||
|
|
||||||
AbstractAnyTypeDeclaration(int i) {
|
AbstractAnyTypeDeclaration(int i) {
|
||||||
super(i);
|
super(i);
|
||||||
@ -44,16 +42,8 @@ abstract class AbstractAnyTypeDeclaration extends AbstractJavaNode implements AS
|
|||||||
|
|
||||||
void setQualifiedName(JavaTypeQualifiedName qualifiedName) {
|
void setQualifiedName(JavaTypeQualifiedName qualifiedName) {
|
||||||
this.qualifiedName = 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,8 +55,6 @@ public final class InternalApiBridge {
|
|||||||
public static void setTypeDefinition(TypeNode node, JavaTypeDefinition definition) {
|
public static void setTypeDefinition(TypeNode node, JavaTypeDefinition definition) {
|
||||||
if (node instanceof AbstractJavaTypeNode) {
|
if (node instanceof AbstractJavaTypeNode) {
|
||||||
((AbstractJavaTypeNode) node).setTypeDefinition(definition);
|
((AbstractJavaTypeNode) node).setTypeDefinition(definition);
|
||||||
} else if (node instanceof AbstractAnyTypeDeclaration) {
|
|
||||||
((AbstractAnyTypeDeclaration) node).setTypeDefinition(definition);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user