Rename RecordDeclaration::getComponentList to getRecordComponents

This name is clearer when seen from the
interface ASTAnyTypeDeclaration, also
it matches the Class API
This commit is contained in:
Clément Fournier
2020-04-16 14:26:42 +02:00
parent 954bfb28d4
commit ea532e6d2d
3 changed files with 22 additions and 0 deletions

View File

@ -57,7 +57,18 @@ public final class ASTRecordDeclaration extends AbstractAnyTypeDeclaration {
return isNested();
}
/**
* @deprecated Renamed to {@link #getRecordComponents()}
*/
@Deprecated
public ASTRecordComponentList getComponentList() {
return getRecordComponents();
}
/** Returns the record component list. */
// @NonNull
@Override
public ASTRecordComponentList getRecordComponents() {
return getFirstChildOfType(ASTRecordComponentList.class);
}
}

View File

@ -53,6 +53,16 @@ public abstract class AbstractAnyTypeDeclaration extends AbstractJavaAccessTypeN
return getImage();
}
/**
* Returns the record component list, or null if this is not a record
* declaration.
*/
// @Nullable // TODO pull up to ASTAnyTypeDecl on 7.0.x
public ASTRecordComponentList getRecordComponents() {
return getFirstChildOfType(ASTRecordComponentList.class);
}
/**
* Returns true if the enclosing type of this type declaration
* is any of the given kinds. If this declaration is a top-level