Rename PermittedSubclasses to PermitsList
This commit is contained in:
@ -1205,7 +1205,7 @@ void ImplementsList():
|
||||
( "," (TypeAnnotation())* ClassOrInterfaceType() )*
|
||||
}
|
||||
|
||||
void PermittedSubclasses():
|
||||
void PermittedSubclasses() #PermitsList:
|
||||
{
|
||||
Token t;
|
||||
checkForSealedClassUsage();
|
||||
|
@ -144,7 +144,7 @@ public class ASTClassOrInterfaceDeclaration extends AbstractAnyTypeDeclaration {
|
||||
|
||||
@Experimental
|
||||
public List<ASTClassOrInterfaceType> getPermittedSubclasses() {
|
||||
ASTPermittedSubclasses permitted = getFirstChildOfType(ASTPermittedSubclasses.class);
|
||||
ASTPermitsList permitted = getFirstChildOfType(ASTPermitsList.class);
|
||||
return permitted == null
|
||||
? Collections.<ASTClassOrInterfaceType>emptyList()
|
||||
: CollectionUtil.toList(permitted.iterator());
|
||||
|
@ -17,18 +17,19 @@ import net.sourceforge.pmd.annotation.Experimental;
|
||||
* <p>See https://openjdk.java.net/jeps/360
|
||||
*
|
||||
* <pre class="grammar">
|
||||
*
|
||||
* PermittedSubclasses ::= "permits" (TypeAnnotation)* ClassOrInterfaceType
|
||||
* ( "," (TypeAnnotation)* ClassOrInterfaceType )*
|
||||
* </pre>
|
||||
*/
|
||||
@Experimental
|
||||
public final class ASTPermittedSubclasses extends AbstractJavaNode implements Iterable<ASTClassOrInterfaceType> {
|
||||
public final class ASTPermitsList extends AbstractJavaNode implements Iterable<ASTClassOrInterfaceType> {
|
||||
|
||||
ASTPermittedSubclasses(int id) {
|
||||
ASTPermitsList(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
ASTPermittedSubclasses(JavaParser p, int id) {
|
||||
ASTPermitsList(JavaParser p, int id) {
|
||||
super(p, id);
|
||||
}
|
||||
|
@ -945,7 +945,7 @@ public class JavaParserDecoratedVisitor implements JavaParserVisitor {
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public Object visit(ASTPermittedSubclasses node, Object data) {
|
||||
public Object visit(ASTPermitsList node, Object data) {
|
||||
visitor.visit(node, data);
|
||||
return visit((JavaNode) node, data);
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ public class JavaParserVisitorAdapter implements JavaParserVisitor {
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public Object visit(ASTPermittedSubclasses node, Object data) {
|
||||
public Object visit(ASTPermitsList node, Object data) {
|
||||
return visit((JavaNode) node, data);
|
||||
}
|
||||
}
|
||||
|
@ -798,7 +798,7 @@ public class JavaParserVisitorDecorator implements JavaParserControllessVisitor
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public Object visit(ASTPermittedSubclasses node, Object data) {
|
||||
public Object visit(ASTPermitsList node, Object data) {
|
||||
return visitor.visit(node, data);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTNameList;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTNormalAnnotation;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTNullLiteral;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPackageDeclaration;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPermittedSubclasses;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPermitsList;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPostfixExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPreDecrementExpression;
|
||||
import net.sourceforge.pmd.lang.java.ast.ASTPreIncrementExpression;
|
||||
@ -875,7 +875,7 @@ public abstract class AbstractJavaRule extends AbstractRule implements JavaParse
|
||||
|
||||
@Override
|
||||
@Experimental
|
||||
public Object visit(ASTPermittedSubclasses node, Object data) {
|
||||
public Object visit(ASTPermitsList node, Object data) {
|
||||
return visit((JavaNode) node, data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user