Rename PermittedSubclasses to PermitsList

This commit is contained in:
Clément Fournier
2020-08-22 19:30:38 +02:00
parent 04850c69bc
commit 2e1e0ed3a4
7 changed files with 11 additions and 10 deletions

View File

@ -1205,7 +1205,7 @@ void ImplementsList():
( "," (TypeAnnotation())* ClassOrInterfaceType() )*
}
void PermittedSubclasses():
void PermittedSubclasses() #PermitsList:
{
Token t;
checkForSealedClassUsage();

View File

@ -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());

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}