From c579576b3204e40ec7550f1a2833ab60277277d6 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Wed, 13 Dec 2023 10:49:13 +0100 Subject: [PATCH] [java] Rename ASTClassOrInterfaceBody to ASTClassBody --- .../pmd/devdocs/experimental/ast_dump.md | 22 +++++----- .../userdocs/extending/writing_rules_intro.md | 2 +- docs/pages/pmd/userdocs/migrating_to_pmd7.md | 13 +++--- docs/pages/release_notes.md | 2 + pmd-java/etc/grammar/Java.jjt | 2 +- .../ast/ASTAnonymousClassDeclaration.java | 2 +- ...OrInterfaceBody.java => ASTClassBody.java} | 6 +-- .../lang/java/ast/ASTClassDeclaration.java | 2 +- .../pmd/lang/java/ast/ASTEnumBody.java | 2 +- .../pmd/lang/java/ast/ASTTypeBody.java | 2 +- .../internal/CognitiveComplexityVisitor.java | 4 +- .../resources/category/java/bestpractices.xml | 10 ++--- .../resources/category/java/codestyle.xml | 8 ++-- .../main/resources/category/java/design.xml | 6 +-- .../resources/category/java/errorprone.xml | 26 ++++++------ .../internal/GetModifiersFunctionsTest.java | 2 +- .../internal/HasAnnotationXPathTest.java | 2 +- .../xpath/internal/TypeIsFunctionTest.java | 2 +- .../lang/java/ast/ASTAnonymousClassTest.kt | 2 +- .../table/internal/MemberInheritanceTest.kt | 2 +- .../sourceforge/pmd/lang/java/ast/Bug1429.txt | 4 +- .../sourceforge/pmd/lang/java/ast/Bug1530.txt | 2 +- .../pmd/lang/java/ast/EmptyStmts1.txt | 2 +- .../pmd/lang/java/ast/EmptyStmts3.txt | 2 +- .../pmd/lang/java/ast/GitHubBug207.txt | 2 +- .../pmd/lang/java/ast/GitHubBug208.txt | 4 +- .../pmd/lang/java/ast/GitHubBug309.txt | 2 +- .../pmd/lang/java/ast/GitHubBug3642.txt | 2 +- .../pmd/lang/java/ast/LambdaBug1333.txt | 2 +- .../pmd/lang/java/ast/LambdaBug1470.txt | 2 +- .../pmd/lang/java/ast/ParserCornerCases.txt | 42 +++++++++---------- .../pmd/lang/java/ast/ParserCornerCases17.txt | 4 +- .../pmd/lang/java/ast/ParserCornerCases18.txt | 14 +++---- .../pmd/lang/java/ast/SwitchStatements.txt | 2 +- .../lang/java/ast/SwitchWithFallthrough.txt | 2 +- .../pmd/lang/java/ast/SynchronizedStmts.txt | 2 +- .../java14/MultipleCaseLabels.txt | 2 +- .../java14/SimpleSwitchExpressions.txt | 2 +- .../java14/SwitchExpressions.txt | 2 +- .../jdkversiontests/java14/SwitchRules.txt | 2 +- .../java14/YieldStatements.txt | 2 +- .../java15/NonSealedIdentifier.txt | 2 +- .../ast/jdkversiontests/java15/TextBlocks.txt | 2 +- .../LocalClassAndInterfaceDeclarations.txt | 6 +-- .../jdkversiontests/java16/LocalRecords.txt | 6 +-- .../java16/NonSealedIdentifier.txt | 2 +- .../java16/PatternMatchingInstanceof.txt | 4 +- .../ast/jdkversiontests/java16/Records.txt | 6 +-- .../ast/jdkversiontests/java17/LocalVars.txt | 2 +- .../java17/SealedInnerClasses.txt | 10 ++--- .../java17/expression/Expr.txt | 2 +- .../jdkversiontests/java17/geometry/Shape.txt | 2 +- .../java17/geometry/Square.txt | 2 +- .../java20p/DealingWithNull.txt | 2 +- .../java20p/EnhancedTypeCheckingSwitch.txt | 2 +- .../java20p/ExhaustiveSwitch.txt | 14 +++---- .../GuardedAndParenthesizedPatterns.txt | 4 +- .../java20p/PatternsInSwitchLabels.txt | 2 +- .../java20p/RecordPatterns.txt | 2 +- .../RecordPatternsExhaustiveSwitch.txt | 12 +++--- .../java20p/RecordPatternsInEnhancedFor.txt | 2 +- .../java20p/RefiningPatternsInSwitch.txt | 8 ++-- .../ScopeOfPatternVariableDeclarations.txt | 2 +- .../java21/AnnotationValueInitializers.txt | 4 +- .../java21/DealingWithNull.txt | 2 +- .../java21/EnhancedTypeCheckingSwitch.txt | 2 +- .../java21/ExhaustiveSwitch.txt | 14 +++---- .../java21/GuardedPatterns.txt | 4 +- .../java21/Jep440_RecordPatterns.txt | 2 +- .../Jep441_PatternMatchingForSwitch.txt | 8 ++-- .../java21/PatternsInSwitchLabels.txt | 2 +- .../jdkversiontests/java21/RecordPatterns.txt | 2 +- .../java21/RecordPatternsExhaustiveSwitch.txt | 12 +++--- .../java21/RefiningPatternsInSwitch.txt | 8 ++-- .../ScopeOfPatternVariableDeclarations.txt | 2 +- .../java21p/Jep430_StringTemplates.txt | 2 +- .../Jep443_UnnamedPatternsAndVariables.txt | 14 +++---- .../pmd/lang/java/types/IteratorUtilCopy.txt | 30 ++++++------- 78 files changed, 212 insertions(+), 211 deletions(-) rename pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/{ASTClassOrInterfaceBody.java => ASTClassBody.java} (73%) diff --git a/docs/pages/pmd/devdocs/experimental/ast_dump.md b/docs/pages/pmd/devdocs/experimental/ast_dump.md index c2c97cd7ed..13c52f5f1d 100644 --- a/docs/pages/pmd/devdocs/experimental/ast_dump.md +++ b/docs/pages/pmd/devdocs/experimental/ast_dump.md @@ -69,18 +69,16 @@ $ cat Foo.xml - - - - - - - - - - - - + + + + + + + + + + diff --git a/docs/pages/pmd/userdocs/extending/writing_rules_intro.md b/docs/pages/pmd/userdocs/extending/writing_rules_intro.md index 17aa3fc325..d578efdafb 100644 --- a/docs/pages/pmd/userdocs/extending/writing_rules_intro.md +++ b/docs/pages/pmd/userdocs/extending/writing_rules_intro.md @@ -52,7 +52,7 @@ class Foo extends Object { └─ ClassDeclaration "Foo" ├─ ExtendsList │ └─ ClassType "Object" - └─ ClassOrInterfaceBody + └─ ClassBody ``` diff --git a/docs/pages/pmd/userdocs/migrating_to_pmd7.md b/docs/pages/pmd/userdocs/migrating_to_pmd7.md index c0eb849ccd..0e2f82b6b4 100644 --- a/docs/pages/pmd/userdocs/migrating_to_pmd7.md +++ b/docs/pages/pmd/userdocs/migrating_to_pmd7.md @@ -398,6 +398,7 @@ which can also display the AST. * AnyTypeDeclaration ➡️ TypeDeclaration ({% jdoc jast::ASTTypeDeclaration %}) * MethodOrConstructorDeclaration ➡️ ExecutableDeclaration ({% jdoc jast::ASTExecutableDeclaration %}) * VariableDeclaratorId ➡️ VariableId ({% jdoc jast::ASTVariableId %}) +* ClassOrInterfaceBody ➡️ ClassBody ({% jdoc jast::ASTClassBody %}) #### Annotations @@ -615,7 +616,7 @@ Top-level type declaration ├─ ModifierList │ └─ Annotation "A" │ └─ ClassType "A" - └─ ClassOrInterfaceBody + └─ ClassBody {% endhighlight %} @@ -1383,7 +1384,7 @@ public @A class C {} ├─ ModifierList │ └─ Annotation "A" │ └─ ClassType "A" - └─ ClassOrInterfaceBody + └─ ClassBody {% endhighlight %} @@ -1428,7 +1429,7 @@ public class Flat { └─ CompilationUnit └─ ClassDeclaration "Flat" ├─ ModifierList - └─ ClassOrInterfaceBody + └─ ClassBody └─ FieldDeclaration ├─ ModifierList ├─ PrimitiveType "int" @@ -1601,7 +1602,7 @@ Object anonymous = new Object() { }; ├─ ArgumentList └─ AnonymousClassDeclaration ├─ ModifierList - └─ ClassOrInterfaceBody + └─ ClassBody {% endhighlight %} @@ -1668,7 +1669,7 @@ public class Sample { {% highlight js %} -└─ ClassOrInterfaceBody +└─ ClassBody ├─ ConstructorDeclaration[ @Name = 'Sample' ] │ ├─ ModifierList │ ├─ FormalParameters @@ -2257,7 +2258,7 @@ class LocalClass {} └─ LocalClassStatement └─ ClassDeclaration "LocalClass" ├─ ModifierList - └─ ClassOrInterfaceBody + └─ ClassBody {% endhighlight %} diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7895cf9bde..abe58cecb6 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -179,6 +179,8 @@ The following previously deprecated classes have been removed: directly, e.g. through downcasting. Or when using the XPath function `pmd-java:nodeIs()`. * The node `ASTVariableDeclaratorId` has been renamed to {% jdoc java::lang.ast.ASTVariableId %}. XPath rules need to be adjusted. + * The node `ASTClassOrInterfaceBody` has been renamed to {% jdoc java::lang.ast.ASTClassBody %}. XPath rules + need to be adjusted. **Deprecated classes and methods** diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 7e94e10172..f38271fc25 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1373,7 +1373,7 @@ void TypeParameter(): {setLastTokenImage(jjtThis);} [ "extends" IntersectionType() ] } -void ClassOrInterfaceBody(): +void ClassOrInterfaceBody() #ClassBody: {} { "{" { tokenContexts.push(TokenContext.BLOCK); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassDeclaration.java index 7cfe687404..1c1a322151 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassDeclaration.java @@ -19,7 +19,7 @@ import net.sourceforge.pmd.lang.java.types.JTypeMirror; * *
  *
- * AnonymousClassDeclaration ::= {@link ASTModifierList EmptyModifierList} {@link ASTClassOrInterfaceBody}
+ * AnonymousClassDeclaration ::= {@link ASTModifierList EmptyModifierList} {@link ASTClassBody}
  *
  * 
*/ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceBody.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassBody.java similarity index 73% rename from pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceBody.java rename to pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassBody.java index 6733cc2651..85ba96d073 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassOrInterfaceBody.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassBody.java @@ -10,13 +10,13 @@ package net.sourceforge.pmd.lang.java.ast; * *
  *
- * ClassOrInterfaceBody ::=  "{"  {@linkplain ASTBodyDeclaration ClassOrInterfaceBodyDeclaration}* "}"
+ * ClassBody ::=  "{"  {@linkplain ASTBodyDeclaration ClassBodyDeclaration}* "}"
  *
  * 
*/ -public final class ASTClassOrInterfaceBody extends ASTTypeBody { +public final class ASTClassBody extends ASTTypeBody { - ASTClassOrInterfaceBody(int id) { + ASTClassBody(int id) { super(id); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassDeclaration.java index dbb1b58960..90e4fb7729 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassDeclaration.java @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.ast.Node; * {@link ASTTypeParameters TypeParameters}? * {@link ASTExtendsList ExtendsList}? * {@link ASTImplementsList ImplementsList}? - * {@link ASTClassOrInterfaceBody ClassOrInterfaceBody} + * {@link ASTClassBody ClassBody} * * */ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumBody.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumBody.java index 5b2eeb77cc..0a81de6731 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumBody.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumBody.java @@ -12,7 +12,7 @@ package net.sourceforge.pmd.lang.java.ast; * EnumBody ::= "{" * [ {@link ASTEnumConstant EnumConstant} ( "," ( {@link ASTEnumConstant EnumConstant} )* ] * [ "," ] - * [ ";" ( {@link ASTBodyDeclaration ClassOrInterfaceBodyDeclaration} )* ] + * [ ";" ( {@link ASTBodyDeclaration BodyDeclaration} )* ] * "}" * * diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBody.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBody.java index 2a498eab0c..232d7b1a62 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBody.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBody.java @@ -9,7 +9,7 @@ package net.sourceforge.pmd.lang.java.ast; * *
  *
- * TypeBody ::= {@link ASTClassOrInterfaceBody ClassOrInterfaceBody}
+ * TypeBody ::= {@link ASTClassBody ClassBody}
  *            | {@link ASTEnumBody EnumBody}
  *            | {@link ASTRecordBody RecordBody}
  *            | {@link ASTAnnotationTypeBody AnnotationTypeBody}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/metrics/internal/CognitiveComplexityVisitor.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/metrics/internal/CognitiveComplexityVisitor.java
index 5b8a717331..9bcf86b6aa 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/metrics/internal/CognitiveComplexityVisitor.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/metrics/internal/CognitiveComplexityVisitor.java
@@ -10,7 +10,7 @@ import java.util.Deque;
 import net.sourceforge.pmd.lang.java.ast.ASTBlock;
 import net.sourceforge.pmd.lang.java.ast.ASTBreakStatement;
 import net.sourceforge.pmd.lang.java.ast.ASTCatchClause;
-import net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceBody;
+import net.sourceforge.pmd.lang.java.ast.ASTClassBody;
 import net.sourceforge.pmd.lang.java.ast.ASTConditionalExpression;
 import net.sourceforge.pmd.lang.java.ast.ASTContinueStatement;
 import net.sourceforge.pmd.lang.java.ast.ASTDoStatement;
@@ -270,7 +270,7 @@ public class CognitiveComplexityVisitor extends JavaVisitorBase
                 
 
                 
             
@@ -514,7 +514,7 @@ public class Foo {
             
                 
                     
                 
             
@@ -774,7 +774,7 @@ In TestNG, only methods annotated with the @Test annotation are executed.
 
 
                 
@@ -116,7 +116,7 @@ visibility cannot be reduced). Clarify your intent by using private or package a
                 
 
                 
@@ -219,7 +219,7 @@ another constructor (such as an overloaded constructor) is called, this rule wil
                 
 
                 
@@ -432,7 +432,7 @@ usage by developers who should be implementing their own versions in the concret
                 
 
                 
 
                 
 
 
                 
@@ -2318,7 +2318,7 @@ chain needs an own serialVersionUID field. See also [Should an abstract class ha
 
                 
@@ -2365,26 +2365,26 @@ $topLevelClass[
                 pmd-java:hasAnnotation('lombok.RequiredArgsConstructor') or
                 pmd-java:hasAnnotation('lombok.AllArgsConstructor')) and
             (: or has non-default constructors … :)
-            ClassOrInterfaceBody/ConstructorDeclaration and
+            ClassBody/ConstructorDeclaration and
                 (: … but only private … :)
-                not(ClassOrInterfaceBody/ConstructorDeclaration[@Visibility != "private"]) and
+                not(ClassBody/ConstructorDeclaration[@Visibility != "private"]) and
                 (: … and none annotated … :)
                 (every $x in $annotations satisfies
-                      not(ClassOrInterfaceBody/ConstructorDeclaration/ModifierList/Annotation[pmd-java:typeIs($x)]))
+                      not(ClassBody/ConstructorDeclaration/ModifierList/Annotation[pmd-java:typeIs($x)]))
         )
     ]
     [
         (: With no visible static methods … :)
-        not(ClassOrInterfaceBody/MethodDeclaration[($isLombokUtility or pmd-java:modifiers() = "static") and @Visibility != "private"]) and
+        not(ClassBody/MethodDeclaration[($isLombokUtility or pmd-java:modifiers() = "static") and @Visibility != "private"]) and
         (: … nor fields … :)
-        not(ClassOrInterfaceBody/FieldDeclaration[($isLombokUtility or pmd-java:modifiers() = "static") and @Visibility != "private"]) and
+        not(ClassBody/FieldDeclaration[($isLombokUtility or pmd-java:modifiers() = "static") and @Visibility != "private"]) and
         (: … no nested classes, that are non-private and static … :)
-        not(ClassOrInterfaceBody/ClassDeclaration
+        not(ClassBody/ClassDeclaration
             [pmd-java:modifiers() = "static" and @Visibility != "private"]
             (: … with a default or non-private constructor … :)
-            [not(ClassOrInterfaceBody/ConstructorDeclaration) or ClassOrInterfaceBody/ConstructorDeclaration[@Visibility != "private"]]
+            [not(ClassBody/ConstructorDeclaration) or ClassBody/ConstructorDeclaration[@Visibility != "private"]]
             (: … and a non-private method returning the outer class type … :)
-            [(ClassOrInterfaceBody/MethodDeclaration
+            [(ClassBody/MethodDeclaration
                 [@Visibility != "private"]
                 [descendant::ReturnStatement/*[1][pmd-java:typeIs(ancestor::ClassDeclaration[@Nested = false()]/@BinaryName)]]
             ) or (
@@ -2428,7 +2428,7 @@ log4j2 (since 6.19.0).
                 
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/GetModifiersFunctionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/GetModifiersFunctionsTest.java
index 3b95a35e8c..da6ec72aed 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/GetModifiersFunctionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/GetModifiersFunctionsTest.java
@@ -39,7 +39,7 @@ class GetModifiersFunctionsTest extends BaseXPathFunctionTest {
 
     @Test
     void testNotModifierOwnerReturnsEmptySequence() {
-        Rule rule = makeXpathRuleFromXPath("//ClassOrInterfaceBody[pmd-java:modifiers()]");
+        Rule rule = makeXpathRuleFromXPath("//ClassBody[pmd-java:modifiers()]");
         String code = "interface O { class Foo { } }";
 
         assertFinds(rule, 0, code);
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/HasAnnotationXPathTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/HasAnnotationXPathTest.java
index 51e396e4a0..7d017f68e6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/HasAnnotationXPathTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/HasAnnotationXPathTest.java
@@ -35,7 +35,7 @@ class HasAnnotationXPathTest extends BaseXPathFunctionTest {
 
     @Test
     void testWrongTypeReturnsFalse() {
-        Rule rule = makeXpathRuleFromXPath("//ClassOrInterfaceBody[pmd-java:hasAnnotation('java.lang.Override')]");
+        Rule rule = makeXpathRuleFromXPath("//ClassBody[pmd-java:hasAnnotation('java.lang.Override')]");
         String code = "interface O { @Override void foo(); }";
 
         assertFinds(rule, 0, code);
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/TypeIsFunctionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/TypeIsFunctionTest.java
index fc0034c345..7011e9d175 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/TypeIsFunctionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/TypeIsFunctionTest.java
@@ -40,7 +40,7 @@ class TypeIsFunctionTest extends BaseXPathFunctionTest {
 
     @Test
     void testWrongTypeReturnsFalse() {
-        Rule rule = makeXpathRuleFromXPath("//ClassOrInterfaceBody[pmd-java:typeIs('java.lang.Override')]");
+        Rule rule = makeXpathRuleFromXPath("//ClassBody[pmd-java:typeIs('java.lang.Override')]");
 
         assertFinds(rule, 0, "interface O { @Override void foo(); }");
     }
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt
index c1ed6d5d90..9443e7e55a 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt
@@ -45,7 +45,7 @@ class ASTAnonymousClassTest : ParserTestSpec({
 
                             val anon = it
 
-                            child {
+                            child {
                                 child(ignoreChildren = true) {
                                     it::getEnclosingType shouldBe anon
                                 }
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt
index 6755b4ef5b..47f9947c13 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt
@@ -265,7 +265,7 @@ class MemberInheritanceTest : ParserTestSpec({
                 acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror }
 
         val insideFoo =
-                acu.descendants(ASTClassOrInterfaceBody::class.java)
+                acu.descendants(ASTClassBody::class.java)
                     .crossFindBoundaries().get(2)!!
 
         val `t_Scratch{String}Inner` = with (acu.typeDsl) {
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt
index 678afde7ff..828c9a4383 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1429", @CanonicalName = "Bug1429", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1429", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "getAttributeTuples", @Name = "getAttributeTuples", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- ClassType[@FullyQualified = false, @SimpleName = "Set"]
@@ -41,7 +41,7 @@
                                        +- ArgumentList[@Empty = true, @Size = 0]
                                        +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Bug1429$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
                                           +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-                                          +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+                                          +- ClassBody[@Empty = false, @Size = 1]
                                              +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Image = "transform", @Name = "transform", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
                                                 +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
                                                 |  +- Annotation[@SimpleName = "Override"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt
index ba53f043b5..661c0612ef 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1530", @CanonicalName = "Bug1530", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1530", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "incChild", @Name = "incChild", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt
index b4e7a3bbd5..be73ae62df 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt
@@ -4,4 +4,4 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "b", @ImportedSimpleName = "b", @PackageName = "", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+      +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt
index 0daa072a5d..eafa99ad6e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt
@@ -4,6 +4,6 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "a", @ImportedSimpleName = "a", @PackageName = "", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "c.Foo", @CanonicalName = "c.Foo", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "c", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
    |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-   |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+   |  +- ClassBody[@Empty = true, @Size = 0]
    +- EmptyDeclaration[]
    +- EmptyDeclaration[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt
index e1da04d952..30662867fb 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug207", @CanonicalName = "GitHubBug207", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug207", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "resourceHttpMessageWriter", @Name = "resourceHttpMessageWriter", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false]
             +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"]
             +- ClassType[@FullyQualified = false, @SimpleName = "HttpMessageWriter"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt
index e8e3c96e17..e486d6ec7a 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug208", @CanonicalName = "GitHubBug208", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug208", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "testMethod", @Name = "testMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
@@ -14,7 +14,7 @@
                      |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Lazy"]
                      |  +- Annotation[@SimpleName = "Configuration"]
                      |     +- ClassType[@FullyQualified = false, @SimpleName = "Configuration"]
-                     +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+                     +- ClassBody[@Empty = false, @Size = 1]
                         +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Image = "foo", @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
                            +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
                            |  +- Annotation[@SimpleName = "Bean"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt
index e3c1f13a8d..f4d9253404 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt
@@ -2,7 +2,7 @@
    +- ImportDeclaration[@ImportOnDemand = true, @ImportedName = "java.util", @ImportedSimpleName = null, @PackageName = "java.util", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug309", @CanonicalName = "GitHubBug309", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug309", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt
index 62d12f2549..d77731b80e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug3642", @CanonicalName = "GitHubBug3642", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug3642", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "GitHubBug3642$Foo", @CanonicalName = "GitHubBug3642.Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Foo", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
             +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"]
             +- AnnotationTypeBody[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt
index 24cc5fdb59..6cd7b1ec63 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1333", @CanonicalName = "Bug1333", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1333", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 4]
+      +- ClassBody[@Empty = false, @Size = 4]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"]
          |  +- ClassType[@FullyQualified = false, @SimpleName = "Logger"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt
index 95d935558d..ce8ec3aa23 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt
@@ -5,7 +5,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "rx.Subscriber", @ImportedSimpleName = "Subscriber", @PackageName = "rx", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.sample.test.pmdTest", @CanonicalName = "com.sample.test.pmdTest", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.sample.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "pmdTest", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+      +- ClassBody[@Empty = false, @Size = 3]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt
index 154a05b235..75deda8747 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Superclass", @CanonicalName = "Superclass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Superclass", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+   |  +- ClassBody[@Empty = false, @Size = 3]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Superclass", @Name = "Superclass", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
    |     |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |     |  +- FormalParameters[@Empty = true, @Size = 0]
@@ -33,7 +33,7 @@
    |              +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Outer", @CanonicalName = "Outer", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Outer", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+   |  +- ClassBody[@Empty = false, @Size = 2]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Outer", @Name = "Outer", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |     |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |     |  +- FormalParameters[@Empty = true, @Size = 0]
@@ -47,7 +47,7 @@
    |     |              +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Outer constructor", @Empty = false, @Image = "\"Outer constructor\"", @Length = 17, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
    |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Outer$Inner", @CanonicalName = "Outer.Inner", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Inner", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |        +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |        +- ClassBody[@Empty = false, @Size = 1]
    |           +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Inner", @Name = "Inner", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |              +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |              +- FormalParameters[@Empty = true, @Size = 0]
@@ -64,7 +64,7 @@
    |  +- ExtendsList[@Empty = false, @Size = 1]
    |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Inner"]
    |  |     +- ClassType[@FullyQualified = false, @SimpleName = "Outer"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Child", @Name = "Child", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |        +- FormalParameters[@Empty = false, @Size = 1]
@@ -87,7 +87,7 @@
    |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |  +- ExtendsList[@Empty = false, @Size = 1]
    |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Superclass"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 8]
+   |  +- ClassBody[@Empty = false, @Size = 8]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
    |     |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |     |  +- FormalParameters[@Empty = true, @Size = 0]
@@ -209,7 +209,7 @@
    |                          +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "shift ", @Empty = false, @Image = "\"shift \"", @Length = 6, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PmdTestParent", @CanonicalName = "PmdTestParent", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdTestParent", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "PmdTestParent", @Name = "PmdTestParent", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |        +- FormalParameters[@Empty = false, @Size = 1]
@@ -222,7 +222,7 @@
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |  +- ExtendsList[@Empty = false, @Size = 1]
    |  |  +- ClassType[@FullyQualified = false, @SimpleName = "PmdTestParent"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "PmdTestChild", @Name = "PmdTestChild", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |        +- FormalParameters[@Empty = true, @Size = 0]
@@ -234,7 +234,7 @@
    |                    +- ArgumentList[@Empty = true, @Size = 0]
    |                    +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "PmdTestChild$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
    |                       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |                       +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |                       +- ClassBody[@Empty = false, @Size = 1]
    |                          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Image = "create", @Name = "create", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
    |                             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |                             +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
@@ -261,7 +261,7 @@
    |                                   +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "memoryMonitor", @Name = "memoryMonitor", @ParenthesisDepth = 0, @Parenthesized = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBean", @CanonicalName = "SimpleBean", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBean", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |        +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -269,7 +269,7 @@
    |           +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser", @CanonicalName = "SimpleBeanUser", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+   |  +- ClassBody[@Empty = false, @Size = 2]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "SimpleBeanUser", @Name = "SimpleBeanUser", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |     |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |     |  +- FormalParameters[@Empty = false, @Size = 1]
@@ -289,7 +289,7 @@
    |                    +- ArgumentList[@Empty = true, @Size = 0]
    |                    +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
    |                       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |                       +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |                       +- ClassBody[@Empty = false, @Size = 1]
    |                          +- Initializer[@Static = false]
    |                             +- Block[@Empty = false, @Size = 1, @containsComment = false]
    |                                +- ExpressionStatement[]
@@ -300,7 +300,7 @@
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |  +- ExtendsList[@Empty = false, @Size = 1]
    |  |  +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBeanUser"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "SimpleBeanUser2", @Name = "SimpleBeanUser2", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |        +- FormalParameters[@Empty = true, @Size = 0]
@@ -312,7 +312,7 @@
    |                    +- ArgumentList[@Empty = true, @Size = 0]
    |                    +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser2$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
    |                       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |                       +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |                       +- ClassBody[@Empty = false, @Size = 1]
    |                          +- Initializer[@Static = false]
    |                             +- Block[@Empty = false, @Size = 1, @containsComment = false]
    |                                +- ExpressionStatement[]
@@ -321,7 +321,7 @@
    |                                      +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test2", @Empty = false, @Image = "\"test2\"", @Length = 5, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "TestParseAnnototation", @CanonicalName = "TestParseAnnototation", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "TestParseAnnototation", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "parse", @Name = "parse", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |        +- VoidType[]
@@ -396,10 +396,10 @@
    |              +- Block[@Empty = true, @Size = 0, @containsComment = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "FooBlock", @CanonicalName = "FooBlock", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "FooBlock", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+   |  +- ClassBody[@Empty = true, @Size = 0]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "MyFoo", @CanonicalName = "MyFoo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyFoo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "MyFoo", @Name = "MyFoo", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |        +- FormalParameters[@Empty = false, @Size = 1]
@@ -412,7 +412,7 @@
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |  +- ExtendsList[@Empty = false, @Size = 1]
    |  |  +- ClassType[@FullyQualified = false, @SimpleName = "MyFoo"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Foo", @Name = "Foo", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
    |        +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |        +- FormalParameters[@Empty = true, @Size = 0]
@@ -424,7 +424,7 @@
    |                    +- ArgumentList[@Empty = true, @Size = 0]
    |                    +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Foo$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
    |                       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |                       +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |                       +- ClassBody[@Empty = false, @Size = 1]
    |                          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Image = "valueOf", @Name = "valueOf", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
    |                             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |                             +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
@@ -444,7 +444,7 @@
    |                                   +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fish", @Name = "fish", @ParenthesisDepth = 0, @Parenthesized = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SuperTest", @CanonicalName = "SuperTest", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SuperTest", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
    |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |  +- ClassBody[@Empty = false, @Size = 1]
    |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "iterator", @Name = "iterator", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
    |        +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |        +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"]
@@ -468,7 +468,7 @@
    |           |           +- ArgumentList[@Empty = true, @Size = 0]
    |           |           +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SuperTest$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS]
    |           |              +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |           |              +- ClassOrInterfaceBody[@Empty = false, @Size = 4]
+   |           |              +- ClassBody[@Empty = false, @Size = 4]
    |           |                 +- FieldDeclaration[@EffectiveVisibility = Visibility.V_ANONYMOUS, @Static = false, @Visibility = Visibility.V_PACKAGE]
    |           |                 |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |           |                 |  +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"]
@@ -529,7 +529,7 @@
    |                 +- ArgumentList[@Empty = true, @Size = 0]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ClazzPropertyOfPrimitiveTypes", @CanonicalName = "ClazzPropertyOfPrimitiveTypes", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ClazzPropertyOfPrimitiveTypes", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @Name = "test", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
index 6e3786f234..7769ff7bd9 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt
@@ -12,7 +12,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.zip.ZipEntry", @ImportedSimpleName = "ZipEntry", @PackageName = "java.util.zip", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases17", @CanonicalName = "ParserCornerCases17", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases17", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 9]
+      +- ClassBody[@Empty = false, @Size = 9]
          +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Image = "ParserCornerCases17", @Name = "ParserCornerCases17", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
          |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
          |  +- FormalParameters[@Empty = true, @Size = 0]
@@ -313,7 +313,7 @@
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
          |  |  +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+         |  +- ClassBody[@Empty = false, @Size = 1]
          |     +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "MyClass", @Name = "MyClass", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
          |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
          |        +- TypeParameters[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt
index 9ecbbf1134..80227b0a14 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt
@@ -11,7 +11,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Stream", @ImportedSimpleName = "Stream", @PackageName = "java.util.stream", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18", @CanonicalName = "ParserCornerCases18", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases18", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
    |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 30]
+   |  +- ClassBody[@Empty = false, @Size = 30]
    |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "lambdas", @Name = "lambdas", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
    |     |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |     |  +- VoidType[]
@@ -466,7 +466,7 @@
    |     |  |  +- TypeParameter[@Image = "A", @Name = "A", @TypeBound = false]
    |     |  |  +- TypeParameter[@Image = "B", @Name = "B", @TypeBound = false]
    |     |  |  +- TypeParameter[@Image = "C", @Name = "C", @TypeBound = false]
-   |     |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |     |  +- ClassBody[@Empty = false, @Size = 1]
    |     |     +- MethodDeclaration[@Abstract = true, @Arity = 3, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "accept", @Name = "accept", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
    |     |        +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"]
    |     |        +- VoidType[]
@@ -667,7 +667,7 @@
    |     |                 +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10]
    |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$PmdMethodReferenceTest", @CanonicalName = "ParserCornerCases18.PmdMethodReferenceTest", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdMethodReferenceTest", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
    |     |  +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
-   |     |  +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+   |     |  +- ClassBody[@Empty = false, @Size = 3]
    |     |     +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE]
    |     |     |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |     |     |  +- ClassType[@FullyQualified = false, @SimpleName = "Function"]
@@ -747,7 +747,7 @@
    |     |  |        +- ClassType[@FullyQualified = false, @SimpleName = "T"]
    |     |  |           +- Annotation[@SimpleName = "Readonly"]
    |     |  |              +- ClassType[@FullyQualified = false, @SimpleName = "Readonly"]
-   |     |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+   |     |  +- ClassBody[@Empty = true, @Size = 0]
    |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "monitorTemperature", @Name = "monitorTemperature", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
    |     |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |     |  +- VoidType[]
@@ -759,7 +759,7 @@
    |     |  +- Block[@Empty = true, @Size = 0, @containsComment = false]
    |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$X", @CanonicalName = "ParserCornerCases18.X", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "X", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
    |     |  +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
-   |     |  +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+   |     |  +- ClassBody[@Empty = false, @Size = 3]
    |     |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "lambaWithIf", @Name = "lambaWithIf", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
    |     |     |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
    |     |     |  +- VoidType[]
@@ -1113,7 +1113,7 @@
    |     |  +- AnnotationTypeBody[@Empty = true, @Size = 0]
    |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$Inner", @CanonicalName = "ParserCornerCases18.Inner", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Inner", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
    |        +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-   |        +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+   |        +- ClassBody[@Empty = false, @Size = 1]
    |           +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Inner", @Name = "Inner", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
    |              +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
    |              +- FormalParameters[@Empty = true, @Size = 0]
@@ -1124,7 +1124,7 @@
       +- ModifierList[@EffectiveModifiers = "{abstract}", @ExplicitModifiers = "{}"]
       +- TypeParameters[@Empty = false, @Size = 1]
       |  +- TypeParameter[@Image = "E", @Name = "E", @TypeBound = false]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 5]
+      +- ClassBody[@Empty = false, @Size = 5]
          +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "hasNext", @Name = "hasNext", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
index 1f230cbeeb..4e398f3a8b 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchStatements", @CanonicalName = "SwitchStatements", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchStatements", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "myMethod", @Name = "myMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
index bee8a84e03..8ebe60b526 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchWithFallthrough", @CanonicalName = "SwitchWithFallthrough", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchWithFallthrough", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "myMethod", @Name = "myMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt
index 8751ce637c..0021271b27 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Sync", @CanonicalName = "Sync", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sync", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "getInstance", @Name = "getInstance", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
index 9dc224a349..c25973a095 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "MultipleCaseLabels", @CanonicalName = "MultipleCaseLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MultipleCaseLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 8]
+      +- ClassBody[@Empty = false, @Size = 8]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
index 868663d3a6..5e189a218e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleSwitchExpressions", @CanonicalName = "SimpleSwitchExpressions", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleSwitchExpressions", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 9]
+      +- ClassBody[@Empty = false, @Size = 9]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
index a408337e88..f5cb473402 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchExpressions", @CanonicalName = "SwitchExpressions", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchExpressions", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 6]
+      +- ClassBody[@Empty = false, @Size = 6]
          +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchExpressions$Day", @CanonicalName = "SwitchExpressions.Day", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Day", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private}"]
          |  +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 7, @TrailingComma = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
index 0245cc0399..63ea833b7d 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchRules", @CanonicalName = "SwitchRules", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchRules", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 8]
+      +- ClassBody[@Empty = false, @Size = 8]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
index a110a5bd00..697e9158b8 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "YieldStatements", @CanonicalName = "YieldStatements", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "YieldStatements", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- Initializer[@Static = false]
             +- Block[@Empty = false, @Size = 5, @containsComment = false]
                +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt
index c40d34f425..ff15efe09b 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "NonSealedIdentifier", @CanonicalName = "NonSealedIdentifier", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NonSealedIdentifier", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt
index 7767bdecdb..263912d333 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt
@@ -3,7 +3,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "javax.script.ScriptEngineManager", @ImportedSimpleName = "ScriptEngineManager", @PackageName = "javax.script", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "TextBlocks", @CanonicalName = "TextBlocks", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "TextBlocks", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt
index 456df68fbb..e96f339dec 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt
@@ -1,13 +1,13 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations", @CanonicalName = "LocalClassAndInterfaceDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalClassAndInterfaceDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- Initializer[@Static = false]
             +- Block[@Empty = false, @Size = 3, @containsComment = true]
                +- LocalClassStatement[]
                |  +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyLocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL]
                |     +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-               |     +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+               |     +- ClassBody[@Empty = false, @Size = 3]
                |        +- FieldDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Static = true, @Visibility = Visibility.V_PACKAGE]
                |        |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
                |        |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -27,7 +27,7 @@
                +- LocalClassStatement[]
                |  +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalInterface", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = true, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "MyLocalInterface", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL]
                |     +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"]
-               |     +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+               |     +- ClassBody[@Empty = true, @Size = 0]
                +- LocalClassStatement[]
                   +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalEnum", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = true, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyLocalEnum", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL]
                      +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt
index 7a4c98f63b..3049ef8558 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt
@@ -3,10 +3,10 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords", @CanonicalName = "LocalRecords", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalRecords", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 6]
+      +- ClassBody[@Empty = false, @Size = 6]
          +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$Merchant", @CanonicalName = "LocalRecords.Merchant", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Merchant", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
          |  +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "computeSales", @Name = "computeSales", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE]
@@ -155,7 +155,7 @@
          |     +- LocalClassStatement[]
          |        +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyLocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyLocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL]
          |           +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-         |           +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |           +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "methodWithLocalVarsNamedSealed", @Name = "methodWithLocalVarsNamedSealed", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt
index c40d34f425..ff15efe09b 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "NonSealedIdentifier", @CanonicalName = "NonSealedIdentifier", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NonSealedIdentifier", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt
index a6e9914cd5..9df3d23077 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt
@@ -11,7 +11,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.annotation.Target", @ImportedSimpleName = "Target", @PackageName = "java.lang.annotation", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof", @CanonicalName = "PatternMatchingInstanceof", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternMatchingInstanceof", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 5]
+      +- ClassBody[@Empty = false, @Size = 5]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
          |  +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -285,7 +285,7 @@
          |           +- ArgumentList[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof$Foo", @CanonicalName = "PatternMatchingInstanceof.Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+         |  +- ClassBody[@Empty = false, @Size = 1]
          |     +- Initializer[@Static = false]
          |        +- Block[@Empty = false, @Size = 2, @containsComment = false]
          |           +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt
index 66d6220c92..151e02e111 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt
@@ -5,7 +5,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Objects", @ImportedSimpleName = "Objects", @PackageName = "java.util", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records", @CanonicalName = "Records", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Records", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 10]
+      +- ClassBody[@Empty = false, @Size = 10]
          +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Records$Nullable", @CanonicalName = "Records.Nullable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nullable", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"]
          |  |  +- Annotation[@SimpleName = "Target"]
@@ -89,7 +89,7 @@
          |     |  +- RecordBody[@Empty = true, @Size = 0]
          |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex$NestedClass", @CanonicalName = "Records.MyComplex.NestedClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NestedClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
          |        +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
-         |        +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |        +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$Range", @CanonicalName = "Records.Range", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Range", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
          |  +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
@@ -218,7 +218,7 @@
          |                    +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
          +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Records$Person", @CanonicalName = "Records.Person", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Person", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
          |  +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+         |  +- ClassBody[@Empty = false, @Size = 2]
          |     +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "firstName", @Name = "firstName", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
          |     |  +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"]
          |     |  +- ClassType[@FullyQualified = false, @SimpleName = "String"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt
index 5447195cb9..68646c5aa4 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalVars", @CanonicalName = "LocalVars", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalVars", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "aMethod", @Name = "aMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt
index e44ec5c316..1ca67aec27 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt
@@ -1,26 +1,26 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses", @CanonicalName = "SealedInnerClasses", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SealedInnerClasses", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+      +- ClassBody[@Empty = false, @Size = 2]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square", @CanonicalName = "SealedInnerClasses.Square", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Square", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{sealed}", @ExplicitModifiers = "{sealed}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+         |  +- ClassBody[@Empty = false, @Size = 2]
          |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$OtherSquare", @CanonicalName = "SealedInnerClasses.Square.OtherSquare", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "OtherSquare", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PRIVATE]
          |     |  +- ModifierList[@EffectiveModifiers = "{private, non-sealed}", @ExplicitModifiers = "{private, non-sealed}"]
          |     |  +- ExtendsList[@Empty = false, @Size = 1]
          |     |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Square"]
-         |     |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |     |  +- ClassBody[@Empty = true, @Size = 0]
          |     +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$StaticClass", @CanonicalName = "SealedInnerClasses.Square.StaticClass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "StaticClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |        +- ModifierList[@EffectiveModifiers = "{non-sealed, static}", @ExplicitModifiers = "{non-sealed, static}"]
          |        +- ImplementsList[@Empty = false, @Size = 1]
          |        |  +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"]
-         |        +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |        +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Squircle", @CanonicalName = "SealedInnerClasses.Squircle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Squircle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
             +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"]
             +- PermitsList[@Empty = false, @Size = 2]
             |  +- ClassType[@FullyQualified = false, @SimpleName = "Square"]
             |  +- ClassType[@FullyQualified = false, @SimpleName = "StaticClass"]
             |     +- ClassType[@FullyQualified = false, @SimpleName = "Square"]
-            +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+            +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt
index c753aa8240..51c3723317 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt
@@ -8,4 +8,4 @@
       |  +- ClassType[@FullyQualified = false, @SimpleName = "PlusExpr"]
       |  +- ClassType[@FullyQualified = false, @SimpleName = "TimesExpr"]
       |  +- ClassType[@FullyQualified = false, @SimpleName = "NegExpr"]
-      +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+      +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt
index 353c241348..75e751d3a5 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt
@@ -7,4 +7,4 @@
       |  +- ClassType[@FullyQualified = false, @SimpleName = "Circle"]
       |  +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
       |  +- ClassType[@FullyQualified = false, @SimpleName = "Square"]
-      +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+      +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt
index c6d1064165..35eac43c54 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt
@@ -5,4 +5,4 @@
       +- ModifierList[@EffectiveModifiers = "{public, non-sealed}", @ExplicitModifiers = "{public, non-sealed}"]
       +- ExtendsList[@Empty = false, @Size = 1]
       |  +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
-      +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+      +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt
index 99fb5ff6b0..d260ab7cc3 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 6]
+      +- ClassBody[@Empty = false, @Size = 6]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBar", @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt
index 57713d7477..ce76f5cb83 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
    |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-   |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+   |  +- ClassBody[@Empty = false, @Size = 2]
    |     +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
    |     |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
    |     |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt
index 7187b49c76..cad0f6a806 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 13]
+      +- ClassBody[@Empty = false, @Size = 13]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverage", @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -81,17 +81,17 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "A"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "B"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "C"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "S"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "S"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false]
@@ -192,7 +192,7 @@
          |  +- PermitsList[@Empty = false, @Size = 2]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "E"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "F"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
@@ -201,7 +201,7 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
          |  |     +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
          |  |        +- ClassType[@FullyQualified = false, @SimpleName = "String"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
@@ -210,7 +210,7 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
          |  |     +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
          |  |        +- ClassType[@FullyQualified = false, @SimpleName = "Y"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testGenericSealedExhaustive", @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt
index 4b9d988715..67707c653c 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 8]
+      +- ClassBody[@Empty = false, @Size = 8]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
@@ -135,7 +135,7 @@
          |              +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt
index a4a312779b..c2b651b5da 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternsInSwitchLabels", @CanonicalName = "PatternsInSwitchLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt
index 9edc87c3b9..90c78e3da1 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 18]
+      +- ClassBody[@Empty = false, @Size = 18]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt
index f8072b0ae5..f3fa1a0774 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt
@@ -1,31 +1,31 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 7]
+      +- ClassBody[@Empty = false, @Size = 7]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "A"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"]
          |  +- PermitsList[@Empty = false, @Size = 2]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "C"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "D"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt
index 01d0281d3a..47028df11a 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor", @CanonicalName = "RecordPatternsInEnhancedFor", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 9]
+      +- ClassBody[@Empty = false, @Size = 9]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Point", @CanonicalName = "RecordPatternsInEnhancedFor.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt
index 09f185f817..3e0eb65e39 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt
@@ -1,20 +1,20 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 7]
+      +- ClassBody[@Empty = false, @Size = 7]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+         |  +- ClassBody[@Empty = false, @Size = 3]
          |     +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE]
          |     |  +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
          |     |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt
index ad23aa4f5e..4550dad5b2 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 4]
+      +- ClassBody[@Empty = false, @Size = 4]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchBlock", @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt
index 6b68d3efb0..0a631f705a 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt
@@ -9,7 +9,7 @@
    |  |        |     +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
    |  |        +- MemberValuePair[@Image = "b", @Name = "b", @Shorthand = false]
    |  |           +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
-   |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+   |  +- ClassBody[@Empty = true, @Size = 0]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers2", @CanonicalName = "AnnotationValueInitializers2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers2", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
       |  +- Annotation[@SimpleName = "MyAnnotation"]
@@ -20,4 +20,4 @@
       |        |     +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
       |        +- MemberValuePair[@Image = "b", @Name = "b", @Shorthand = false]
       |           +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "#b", @Empty = false, @Image = "\"#b\"", @Length = 2, @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
-      +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+      +- ClassBody[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
index 99fb5ff6b0..d260ab7cc3 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 6]
+      +- ClassBody[@Empty = false, @Size = 6]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBar", @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
index 44f14903d2..14b81974fa 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 4]
+      +- ClassBody[@Empty = false, @Size = 4]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Point", @CanonicalName = "EnhancedTypeCheckingSwitch.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
index 743835f7d4..52aac4ffd9 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 13]
+      +- ClassBody[@Empty = false, @Size = 13]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "coverage", @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -81,17 +81,17 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "A"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "B"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "C"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "S"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "S"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false]
@@ -192,7 +192,7 @@
          |  +- PermitsList[@Empty = false, @Size = 2]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "E"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "F"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
@@ -201,7 +201,7 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
          |  |     +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
          |  |        +- ClassType[@FullyQualified = false, @SimpleName = "String"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
@@ -210,7 +210,7 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
          |  |     +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
          |  |        +- ClassType[@FullyQualified = false, @SimpleName = "Y"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testGenericSealedExhaustive", @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
index a2d315d0e6..72658b201a 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns", @CanonicalName = "GuardedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 8]
+      +- ClassBody[@Empty = false, @Size = 8]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
@@ -105,7 +105,7 @@
          |              +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns$when", @CanonicalName = "GuardedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
index a20dfc7ae9..a930d09e7b 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns", @CanonicalName = "Jep440_RecordPatterns", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep440_RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 15]
+      +- ClassBody[@Empty = false, @Size = 15]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Point", @CanonicalName = "Jep440_RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
index 0093f46971..7c76b950f0 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch", @CanonicalName = "Jep441_PatternMatchingForSwitch", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep441_PatternMatchingForSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 13]
+      +- ClassBody[@Empty = false, @Size = 13]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "formatterPatternSwitch", @Name = "formatterPatternSwitch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -268,7 +268,7 @@
          |  +- PermitsList[@Empty = false, @Size = 2]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Suit"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Suit", @CanonicalName = "Jep441_PatternMatchingForSwitch.Suit", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Suit", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
          |  +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
@@ -290,7 +290,7 @@
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "exhaustiveSwitchWithoutEnumSupport", @Name = "exhaustiveSwitchWithoutEnumSupport", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
@@ -471,7 +471,7 @@
          |  +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"]
          |  +- PermitsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Coin"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Coin", @CanonicalName = "Jep441_PatternMatchingForSwitch.Coin", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Coin", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
index a4a312779b..c2b651b5da 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternsInSwitchLabels", @CanonicalName = "PatternsInSwitchLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 1]
+      +- ClassBody[@Empty = false, @Size = 1]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
             +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
             +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt
index 9edc87c3b9..90c78e3da1 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 18]
+      +- ClassBody[@Empty = false, @Size = 18]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
index f8072b0ae5..f3fa1a0774 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt
@@ -1,31 +1,31 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 7]
+      +- ClassBody[@Empty = false, @Size = 7]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "A"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"]
          |  +- PermitsList[@Empty = false, @Size = 2]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "C"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "D"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "I"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
index 09f185f817..3e0eb65e39 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt
@@ -1,20 +1,20 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 7]
+      +- ClassBody[@Empty = false, @Size = 7]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 3]
+         |  +- ClassBody[@Empty = false, @Size = 3]
          |     +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE]
          |     |  +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
          |     |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
index ad23aa4f5e..4550dad5b2 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt
@@ -1,7 +1,7 @@
 +- CompilationUnit[@PackageName = ""]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC]
       +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 4]
+      +- ClassBody[@Empty = false, @Size = 4]
          +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchBlock", @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- VoidType[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt
index f0235e5ba8..d9b4ef3fb7 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt
@@ -6,7 +6,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.LocalTime", @ImportedSimpleName = "LocalTime", @PackageName = "java.time", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates", @CanonicalName = "Jep430_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep430_StringTemplates", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 9]
+      +- ClassBody[@Empty = false, @Size = 9]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$Request", @CanonicalName = "Jep430_StringTemplates.Request", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Request", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt
index 2479929ec3..946396ac72 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt
@@ -5,7 +5,7 @@
    +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false]
    +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables", @CanonicalName = "Jep443_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep443_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
       +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-      +- ClassOrInterfaceBody[@Empty = false, @Size = 19]
+      +- ClassBody[@Empty = false, @Size = 19]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
@@ -131,22 +131,22 @@
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
          |  +- ExtendsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
          |  +- TypeParameters[@Empty = false, @Size = 1]
@@ -318,7 +318,7 @@
          |  +- Block[@Empty = true, @Size = 0, @containsComment = false]
          +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
          |  +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
-         |  +- ClassOrInterfaceBody[@Empty = true, @Size = 0]
+         |  +- ClassBody[@Empty = true, @Size = 0]
          +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE]
          |  +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"]
          |  +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -495,7 +495,7 @@
          |  +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
          |  +- ImplementsList[@Empty = false, @Size = 1]
          |  |  +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"]
-         |  +- ClassOrInterfaceBody[@Empty = false, @Size = 2]
+         |  +- ClassBody[@Empty = false, @Size = 2]
          |     +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "close", @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
          |     |  +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
          |     |  |  +- Annotation[@SimpleName = "Override"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorUtilCopy.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorUtilCopy.txt
index 8c282c43cb..3a9a10c620 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorUtilCopy.txt
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/types/IteratorUtilCopy.txt
@@ -19,7 +19,7 @@
    +- ImportDeclaration[]
    +- ClassDeclaration[@TypeMirror = "IteratorUtilCopy"]
       +- ModifierList[]
-      +- ClassOrInterfaceBody[]
+      +- ClassBody[]
          +- FieldDeclaration[]
          |  +- ModifierList[]
          |  +- PrimitiveType[@TypeMirror = "int"]
@@ -82,7 +82,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$1"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- MethodDeclaration[@Name = "computeNext"]
          |                    +- ModifierList[]
          |                    |  +- Annotation[@TypeMirror = "java.lang.Override"]
@@ -186,7 +186,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$2"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- FieldDeclaration[]
          |                 |  +- ModifierList[]
          |                 |  +- ClassType[@TypeMirror = "java.util.Iterator"]
@@ -297,7 +297,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$3"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- FieldDeclaration[]
          |                 |  +- ModifierList[]
          |                 |  +- ClassType[@TypeMirror = "java.util.Iterator"]
@@ -419,7 +419,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$4"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- MethodDeclaration[@Name = "computeNext"]
          |                    +- ModifierList[]
          |                    |  +- Annotation[@TypeMirror = "java.lang.Override"]
@@ -498,7 +498,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$5"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- MethodDeclaration[@Name = "computeNext"]
          |                    +- ModifierList[]
          |                    |  +- Annotation[@TypeMirror = "java.lang.Override"]
@@ -607,7 +607,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$6"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- MethodDeclaration[@Name = "hasNext"]
          |                 |  +- ModifierList[]
          |                 |  |  +- Annotation[@TypeMirror = "java.lang.Override"]
@@ -754,7 +754,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$7"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- MethodDeclaration[@Name = "hasNext"]
          |                 |  +- ModifierList[]
          |                 |  |  +- Annotation[@TypeMirror = "java.lang.Override"]
@@ -1098,7 +1098,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$8"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- FieldDeclaration[]
          |                 |  +- ModifierList[]
          |                 |  +- PrimitiveType[@TypeMirror = "int"]
@@ -1174,7 +1174,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$9"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- FieldDeclaration[]
          |                 |  +- ModifierList[]
          |                 |  +- PrimitiveType[@TypeMirror = "int"]
@@ -1248,7 +1248,7 @@
          |           +- ArgumentList[]
          |           +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$10"]
          |              +- ModifierList[]
-         |              +- ClassOrInterfaceBody[]
+         |              +- ClassBody[]
          |                 +- FieldDeclaration[]
          |                 |  +- ModifierList[]
          |                 |  +- ClassType[@TypeMirror = "T"]
@@ -1458,7 +1458,7 @@
          |     |     |  +- ClassType[@TypeMirror = "java.util.Iterator"]
          |     |     |     +- TypeArguments[]
          |     |     |        +- ClassType[@TypeMirror = "T"]
-         |     |     +- ClassOrInterfaceBody[]
+         |     |     +- ClassBody[]
          |     |        +- FieldDeclaration[]
          |     |        |  +- ModifierList[]
          |     |        |  +- PrimitiveType[@TypeMirror = "boolean"]
@@ -1542,7 +1542,7 @@
          |              +- ArgumentList[]
          |              +- AnonymousClassDeclaration[@TypeMirror = "IteratorUtilCopy$11"]
          |                 +- ModifierList[]
-         |                 +- ClassOrInterfaceBody[]
+         |                 +- ClassBody[]
          |                    +- FieldDeclaration[]
          |                    |  +- ModifierList[]
          |                    |  +- ClassType[@TypeMirror = "java.util.ListIterator"]
@@ -1625,7 +1625,7 @@
          |  |  +- ClassType[@TypeMirror = "java.util.Iterator"]
          |  |     +- TypeArguments[]
          |  |        +- ClassType[@TypeMirror = "T"]
-         |  +- ClassOrInterfaceBody[]
+         |  +- ClassBody[]
          |     +- FieldDeclaration[]
          |     |  +- ModifierList[]
          |     |  +- ClassType[@TypeMirror = "IteratorUtilCopy$AbstractIterator$State"]
@@ -1775,7 +1775,7 @@
             |  +- ClassType[@TypeMirror = "IteratorUtilCopy$AbstractIterator"]
             |     +- TypeArguments[]
             |        +- ClassType[@TypeMirror = "T"]
-            +- ClassOrInterfaceBody[]
+            +- ClassBody[]
                +- FieldDeclaration[]
                |  +- ModifierList[]
                |  +- PrimitiveType[@TypeMirror = "int"]