- net.sourceforge.pmd.docs.GenerateRuleDocsCmd
+ net.sourceforge.pmd.doc.internal.GenerateRuleDocsCmd
${project.basedir}
@@ -48,7 +48,7 @@
verify
- net.sourceforge.pmd.docs.DeadLinksChecker
+ net.sourceforge.pmd.doc.internal.DeadLinksChecker
${project.basedir}
@@ -61,7 +61,7 @@
verify
- net.sourceforge.pmd.docs.RuleTagChecker
+ net.sourceforge.pmd.doc.internal.RuleTagChecker
${project.basedir}
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java
similarity index 99%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java
index 9e3b11c5c2..ad849464da 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DeadLinksChecker.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DeadLinksChecker.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.io.InputStream;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java
similarity index 92%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java
index 5c7e84ad2f..3a105f05d2 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/DefaultFileWriter.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/DefaultFileWriter.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java
similarity index 98%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java
index 78e5a4fd57..1dda3b8182 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/EscapeUtils.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/EscapeUtils.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.util.List;
import java.util.regex.Matcher;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java
similarity index 86%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java
index d47452754d..e00b335f02 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/FileWriter.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/FileWriter.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.nio.file.Path;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java
similarity index 98%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java
index 256e605904..c1958e9c39 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/GenerateRuleDocsCmd.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/GenerateRuleDocsCmd.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.File;
import java.io.IOException;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java
similarity index 95%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java
index a5d32cc979..5ad83287e4 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleDocGenerator.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.File;
import java.io.IOException;
@@ -90,6 +90,7 @@ public class RuleDocGenerator {
}
public void generate(List registeredRulesets, List additionalRulesets) throws IOException {
+ removeExistingRuleDocs();
Map> sortedRulesets;
Map> sortedAdditionalRulesets;
sortedRulesets = sortRulesets(registeredRulesets);
@@ -102,6 +103,38 @@ public class RuleDocGenerator {
generateSidebar(sortedRulesets);
}
+ private void removeExistingRuleDocs() throws IOException {
+ Path directory = root.resolve("docs/pages/pmd/rules");
+ if (!Files.isDirectory(directory)) {
+ // no old files exist yet
+ return;
+ }
+
+ System.out.println("Deleting old rule docs in " + directory);
+ Files.walkFileTree(directory, new SimpleFileVisitor() {
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+ if (file.toString().endsWith("scala.md")) {
+ // don't delete scala.md, since we don't have any rules yet...
+ return FileVisitResult.CONTINUE;
+ }
+ Files.delete(file);
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+ if (dir.equals(directory)) {
+ // don't delete the whole directory, keep it empty
+ // or almost empty (scala.md is still present)
+ return FileVisitResult.CONTINUE;
+ }
+ Files.delete(dir);
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ }
+
private void ensureAllLanguages(Map> sortedRulesets) {
for (Language language : LanguageRegistry.PMD.getLanguages()) {
sortedRulesets.putIfAbsent(language, Collections.emptyList());
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java
similarity index 98%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java
index 156946cfbc..2399f96ebd 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleSetUtils.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleSetUtils.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.File;
import java.util.regex.Pattern;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java
similarity index 99%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java
index a1ae35b753..9e41a1fa32 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleTagChecker.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/RuleTagChecker.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java
similarity index 99%
rename from pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java
rename to pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java
index 0982f7fb5b..d9f248eb0c 100644
--- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/SidebarGenerator.java
+++ b/pmd-doc/src/main/java/net/sourceforge/pmd/doc/internal/SidebarGenerator.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.io.Reader;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java
similarity index 98%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java
index 439a9f41bc..fe83327d77 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/EscapeUtilsTest.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/EscapeUtilsTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import static org.junit.jupiter.api.Assertions.assertEquals;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java
similarity index 96%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java
index b954a3a9d3..7173fcc927 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/MockedFileWriter.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/MockedFileWriter.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import java.io.IOException;
import java.nio.file.Path;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java
similarity index 96%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java
index b593280141..cffe8af125 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleDocGeneratorTest.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleDocGeneratorTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -19,7 +19,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
-import net.sourceforge.pmd.docs.MockedFileWriter.FileEntry;
+import net.sourceforge.pmd.doc.internal.MockedFileWriter.FileEntry;
import net.sourceforge.pmd.internal.util.IOUtil;
import net.sourceforge.pmd.lang.rule.RuleSet;
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java
similarity index 98%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java
index bd3ee01d54..9abb6b4618 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleSetResolverTest.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleSetResolverTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import static net.sourceforge.pmd.util.CollectionUtil.listOf;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java
similarity index 97%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java
index 3808b616a5..d9aa3cf7a1 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/RuleTagCheckerTest.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/RuleTagCheckerTest.java
@@ -3,7 +3,7 @@
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import static org.junit.jupiter.api.Assertions.assertEquals;
diff --git a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java
similarity index 98%
rename from pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java
rename to pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java
index 68ce308d5b..81f3392583 100644
--- a/pmd-doc/src/test/java/net/sourceforge/pmd/docs/SidebarGeneratorTest.java
+++ b/pmd-doc/src/test/java/net/sourceforge/pmd/doc/internal/SidebarGeneratorTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.docs;
+package net.sourceforge.pmd.doc.internal;
import static org.junit.jupiter.api.Assertions.assertEquals;
diff --git a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml
index 756c9ece74..dc489db83f 100644
--- a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml
+++ b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml
@@ -98,7 +98,7 @@ entries:
subfolderitems:
- title: Index
output: web, pdf
- url: /pmd_rules_vf.html
+ url: /pmd_rules_visualforce.html
- title: null
output: web, pdf
subfolders:
@@ -125,7 +125,7 @@ entries:
subfolderitems:
- title: Index
output: web, pdf
- url: /pmd_rules_vm.html
+ url: /pmd_rules_velocity.html
- title: null
output: web, pdf
subfolders:
diff --git a/pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml b/pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml
similarity index 100%
rename from pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml
rename to pmd-doc/src/test/resources/net/sourceforge/pmd/doc/internal/sidebar.yml
diff --git a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java
index 4174204f44..992072abae 100644
--- a/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java
+++ b/pmd-fortran/src/test/java/net/sourceforge/pmd/lang/fortran/cpd/FortranCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.fortran.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
/**
* @author rpelisse
diff --git a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java
index 6fde983b27..92d7fcab15 100644
--- a/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java
+++ b/pmd-gherkin/src/test/java/net/sourceforge/pmd/lang/gherkin/cpd/GherkinCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.gherkin.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
class GherkinCpdLexerTest extends CpdTextComparisonTest {
GherkinCpdLexerTest() {
diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml
index 060920664c..1f6720920a 100644
--- a/pmd-go/pom.xml
+++ b/pmd-go/pom.xml
@@ -31,7 +31,7 @@
-
+
diff --git a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java
index e40d2c2b23..571102abf5 100644
--- a/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java
+++ b/pmd-go/src/test/java/net/sourceforge/pmd/lang/go/cpd/GoCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.go.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
class GoCpdLexerTest extends CpdTextComparisonTest {
diff --git a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java
index 647020c363..38ddb03717 100644
--- a/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java
+++ b/pmd-groovy/src/test/java/net/sourceforge/pmd/lang/groovy/cpd/GroovyCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.groovy.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
class GroovyCpdLexerTest extends CpdTextComparisonTest {
diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java
index 26d02710a9..c4809cc487 100644
--- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java
+++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlLanguageModule.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html;
import net.sourceforge.pmd.cpd.CpdLexer;
import net.sourceforge.pmd.lang.LanguagePropertyBundle;
import net.sourceforge.pmd.lang.LanguageRegistry;
-import net.sourceforge.pmd.lang.html.ast.HtmlCpdLexer;
+import net.sourceforge.pmd.lang.html.cpd.HtmlCpdLexer;
import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase;
public final class HtmlLanguageModule extends SimpleLanguageModuleBase {
diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java
similarity index 87%
rename from pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java
rename to pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java
index f7f0668de6..18a2392e08 100644
--- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/ast/HtmlCpdLexer.java
+++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexer.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.lang.html.ast;
+package net.sourceforge.pmd.lang.html.cpd;
import java.io.IOException;
import java.io.UncheckedIOException;
@@ -15,6 +15,10 @@ import net.sourceforge.pmd.lang.ast.Parser.ParserTask;
import net.sourceforge.pmd.lang.ast.SemanticErrorReporter;
import net.sourceforge.pmd.lang.document.TextDocument;
import net.sourceforge.pmd.lang.html.HtmlLanguageModule;
+import net.sourceforge.pmd.lang.html.ast.ASTHtmlDocument;
+import net.sourceforge.pmd.lang.html.ast.ASTHtmlTextNode;
+import net.sourceforge.pmd.lang.html.ast.HtmlNode;
+import net.sourceforge.pmd.lang.html.ast.HtmlParser;
/**
* Note: This class has been called HtmlTokenizer in PMD 6
.
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java
index 0a8b032163..9315ee0525 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/LanguageVersionTest.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html;
import java.util.Arrays;
import java.util.Collection;
-import net.sourceforge.pmd.AbstractLanguageVersionTest;
+import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
class LanguageVersionTest extends AbstractLanguageVersionTest {
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java
index f3255130e1..a79d09a0af 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/RuleSetFactoryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.html;
-import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
+import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
class RuleSetFactoryTest extends AbstractRuleSetFactoryTest {
// no additional tests yet
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java
index 5cf5e3461a..a916551648 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlParsingHelper.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.html.ast;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.html.HtmlLanguageModule;
public final class HtmlParsingHelper extends BaseParsingHelper {
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java
index 864e9a04ed..0809b27f36 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/HtmlTreeDumpTest.java
@@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.html.ast;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
-import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest;
-import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
+import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
class HtmlTreeDumpTest extends BaseTreeDumpTest {
HtmlTreeDumpTest() {
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java
index 2979e52a47..c704e7bf35 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/ast/PositionTest.java
@@ -6,9 +6,9 @@ package net.sourceforge.pmd.lang.html.ast;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
-import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest;
-import net.sourceforge.pmd.lang.ast.test.CoordinatesPrinter;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
+import net.sourceforge.pmd.lang.test.ast.CoordinatesPrinter;
class PositionTest extends BaseTreeDumpTest {
PositionTest() {
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java
index 2039a2f72b..63bc1a03dd 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/cpd/HtmlCpdLexerTest.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.html.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
import net.sourceforge.pmd.lang.html.HtmlLanguageModule;
class HtmlCpdLexerTest extends CpdTextComparisonTest {
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java
index ca4314861d..e3dab36338 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/AvoidInlineStylesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.html.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidInlineStylesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java
index ade5f87078..aaf2915ebf 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UnnecessaryTypeAttributeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.html.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryTypeAttributeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java
index c4904a4aee..a336b2d2de 100644
--- a/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java
+++ b/pmd-html/src/test/java/net/sourceforge/pmd/lang/html/rule/bestpractices/UseAltAttributeForImagesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.html.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseAltAttributeForImagesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt
index 3318fa4083..c29ac79910 100644
--- a/pmd-java/etc/grammar/Java.jjt
+++ b/pmd-java/etc/grammar/Java.jjt
@@ -1,4 +1,16 @@
/**
+ * Support "JEP 447: Statements before super(...) (Preview)" (Java 22)
+ * Changes in ConstructorBlock
+ * Support "JEP 456: Unnamed Variables & Patterns" (Java 22)
+ * This is now a regular language feature. Otherwise no changes.
+ * Support "JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)" (Java 22)
+ * No changes.
+ * Support "JEP 459: String Templates (Second Preview)" (Java 22)
+ * Use ASTTemplate.setContent instead of setImage.
+ * Remove support for Record pattern in enhanced for statements. This was only a Java 20 Preview feature.
+ * Remove support for ParenthesizedPatterns. This was only a Java 20 Preview feature.
+ * Andreas Dangel 02/2024
+ *====================================================================
* Renamed various nodes:
* ClassOrInterfaceType -> ClassType
* ClassOrInterfaceDeclaration -> ClassDeclaration
@@ -1049,7 +1061,7 @@ TOKEN :
// In order to produce the correct token sequence, the ambiguity needs to be resolved using the context.
// That means, that STRING_TEMPLATE_MID/END and TEXT_BLOCK_TEMPLATE_MID/END could actually be a closing bracket ("}").
// Additionally, a STRING_TEMPLATE_MID could be a TEXT_BLOCK_TEMPLATE_MID and the other way round.
-// See JLS 3.13 Fragments (Java 21 Preview)
+// See JLS 3.13 Fragments (Java 21 Preview and Java 22 Preview)
TOKEN :
{
@@ -1147,7 +1159,7 @@ ASTCompilationUnit CompilationUnit() :
// OrdinaryCompilationUnit: -> TopLevelClassOrInterfaceDeclaration
( TypeDeclaration() ( EmptyDeclaration() )* )*
- // UnnamedClassCompilationUnit:
+ // SimpleCompilationUnit:
[
( LOOKAHEAD(3) ClassMemberDeclarationNoMethod() )*
ModifierList() MethodDeclaration()
@@ -1512,7 +1524,12 @@ private void ConstructorBlock() #Block:
{}
{
"{" { tokenContexts.push(TokenContext.BLOCK); }
- [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
+ (
+ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation()
+ |
+ ( LOOKAHEAD(2) BlockStatement() )*
+ [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
+ )
( BlockStatement() )*
"}" { tokenContexts.pop(); }
}
@@ -1895,18 +1912,9 @@ void Pattern() #void:
{}
{
LOOKAHEAD((Annotation())* ReferenceType() "(") RecordPattern()
- | LOOKAHEAD("(") ParenthesizedPattern()
| TypePattern()
}
-// ParenthesizedPatterns are removed with Java 21 (JEP 441), but needed for now to support Java 20 Preview
-// TODO: Remove ParenthesizedPattern once java 20-preview is removed
-void ParenthesizedPattern() #void:
-{}
-{
- "(" Pattern() ")" { AstImplUtil.bumpParenDepth((ASTPattern) jjtree.peekNode()); }
-}
-
void TypePattern():
{}
{
@@ -2341,10 +2349,10 @@ void StringTemplate() #void :
{
{ tokenContexts.push(TokenContext.STRING_TEMPLATE); }
- { setLastTokenImage(jjtThis); } #TemplateFragment
+ { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment
EmbeddedExpression()
- ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )*
- { setLastTokenImage(jjtThis); } #TemplateFragment
+ ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )*
+ { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment
{ tokenContexts.pop(); }
}
@@ -2354,10 +2362,10 @@ void TextBlockTemplate() #void :
{
{ tokenContexts.push(TokenContext.TEXT_BLOCK_TEMPLATE); }
- { setLastTokenImage(jjtThis); } #TemplateFragment
+ { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment
EmbeddedExpression()
- ( { setLastTokenImage(jjtThis); } #TemplateFragment EmbeddedExpression() )*
- { setLastTokenImage(jjtThis); } #TemplateFragment
+ ( { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment EmbeddedExpression() )*
+ { jjtThis.setContent(getToken(0).getImage()); } #TemplateFragment
{ tokenContexts.pop(); }
}
@@ -2771,9 +2779,7 @@ void ForStatement() #void:
void EnhancedForDeclaration() #void:
{}
{
- LOOKAHEAD(LocalVariableDeclaration()) LocalVariableDeclaration()
- // TODO: a recored pattern here is only valid with Java 20 Preview and not anymore with Java 21 (see JEP 440)
- | RecordPattern()
+ LocalVariableDeclaration()
}
void ForInit() :
diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml
index 06570caf2b..0999263c4e 100644
--- a/pmd-java/pom.xml
+++ b/pmd-java/pom.xml
@@ -107,7 +107,7 @@
-
+
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java
index 562b6365e6..393a5983ef 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java
@@ -42,9 +42,10 @@ public class JavaLanguageModule extends LanguageModuleBase implements PmdCapable
.addVersion("18")
.addVersion("19")
.addVersion("20")
- .addVersion("20-preview")
- .addDefaultVersion("21") // 21 is the default
- .addVersion("21-preview"));
+ .addVersion("21")
+ .addVersion("21-preview")
+ .addDefaultVersion("22") // 22 is the default
+ .addVersion("22-preview"));
}
public static JavaLanguageModule getInstance() {
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java
index 214bfcac9c..eeedf1aaa8 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java
@@ -4,8 +4,6 @@
package net.sourceforge.pmd.lang.java.ast;
-import net.sourceforge.pmd.annotation.Experimental;
-
/**
* A pattern for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression}
* or within a {@link ASTSwitchLabel}). This is a JDK 16 feature.
@@ -21,18 +19,7 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
* @see JEP 394: Pattern Matching for instanceof (Java 16)
- * @see JEP 405: Record Patterns (Preview) (Java 19)
- * @see JEP 432: Record Patterns (Second Preview) (Java 20)
* @see JEP 440: Record Patterns (Java 21)
*/
public interface ASTPattern extends JavaNode {
-
- /**
- * Returns the number of parenthesis levels around this pattern.
- * If this method returns 0, then no parentheses are present.
- * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21.
- */
- @Experimental("Parenthesized patterns is a Java 20 Preview feature")
- @Deprecated
- int getParenthesisDepth();
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java
index 20d4e80fce..f16730342f 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java
@@ -5,8 +5,6 @@
package net.sourceforge.pmd.lang.java.ast;
-import net.sourceforge.pmd.annotation.Experimental;
-
/**
* A record pattern, a Java 21 language feature.
*
@@ -17,14 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
* @see ASTRecordDeclaration
- * @see JEP 405: Record Patterns (Preview) (Java 19)
- * @see JEP 432: Record Patterns (Second Preview) (Java 20)
* @see JEP 440: Record Patterns (Java 21)
*/
public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern {
- private int parenDepth;
-
ASTRecordPattern(int id) {
super(id);
}
@@ -45,14 +39,4 @@ public final class ASTRecordPattern extends AbstractJavaNode implements ASTPatte
public ASTVariableId getVarId() {
return firstChild(ASTVariableId.class);
}
-
- void bumpParenDepth() {
- parenDepth++;
- }
-
- @Override
- @Experimental("Parenthesized patterns is a Java 20 Preview feature")
- public int getParenthesisDepth() {
- return parenDepth;
- }
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java
index d1379fbf07..13decf984d 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplate.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast;
import net.sourceforge.pmd.annotation.Experimental;
/**
- * This is a Java 21 Preview feature.
+ * This is a Java 21/22 Preview feature.
*
*
*
@@ -15,9 +15,10 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
*
- * @see JEP 430: String Templates (Preview)
+ * @see JEP 430: String Templates (Preview) (Java 21)
+ * @see JEP 459: String Templates (Second Preview) (Java 22)
*/
-@Experimental("String templates is a Java 21 Preview feature")
+@Experimental("String templates is a Java 21/22 Preview feature")
public final class ASTTemplate extends AbstractJavaNode {
ASTTemplate(int i) {
super(i);
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java
index c612ce5ef7..ef2b512b09 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateExpression.java
@@ -8,7 +8,7 @@ import net.sourceforge.pmd.annotation.Experimental;
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr;
/**
- * This is a Java 21 Preview feature.
+ * This is a Java 21/22 Preview feature.
*
*
*
@@ -17,9 +17,10 @@ import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr
*
*
*
- * @see JEP 430: String Templates (Preview)
+ * @see JEP 430: String Templates (Preview) (Java 21)
+ * @see JEP 459: String Templates (Second Preview) (Java 22)
*/
-@Experimental("String templates is a Java 21 Preview feature")
+@Experimental("String templates is a Java 21/22 Preview feature")
public final class ASTTemplateExpression extends AbstractJavaExpr {
ASTTemplateExpression(int i) {
super(i);
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java
index 2ff13744b0..2ecf0cc3fc 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTemplateFragment.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast;
import net.sourceforge.pmd.annotation.Experimental;
/**
- * This is a Java 21 Preview feature.
+ * This is a Java 21/22 Preview feature.
*
*
*
@@ -16,10 +16,13 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
*
- * @see JEP 430: String Templates (Preview)
+ * @see JEP 430: String Templates (Preview) (Java 21)
+ * @see JEP 459: String Templates (Second Preview) (Java 22)
*/
-@Experimental("String templates is a Java 21 Preview feature")
+@Experimental("String templates is a Java 21/22 Preview feature")
public final class ASTTemplateFragment extends AbstractJavaNode {
+ private String content;
+
ASTTemplateFragment(int i) {
super(i);
}
@@ -28,4 +31,13 @@ public final class ASTTemplateFragment extends AbstractJavaNode {
protected R acceptVisitor(JavaVisitor super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}
+
+ public String getContent() {
+ return content;
+ }
+
+ void setContent(String content) {
+ this.content = content;
+ }
+
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java
index 66fc999e03..3a99a89ea2 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypePattern.java
@@ -8,8 +8,6 @@ import java.util.Objects;
import org.checkerframework.checker.nullness.qual.NonNull;
-import net.sourceforge.pmd.annotation.Experimental;
-
/**
* A type pattern (JDK16). This can be found on
* the right-hand side of an {@link ASTInfixExpression InstanceOfExpression},
@@ -21,12 +19,10 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
*
- * @see JEP 394: Pattern Matching for instanceof
+ * @see JEP 394: Pattern Matching for instanceof (Java 16)
*/
public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern, ModifierOwner {
- private int parenDepth;
-
ASTTypePattern(int id) {
super(id);
}
@@ -47,14 +43,4 @@ public final class ASTTypePattern extends AbstractJavaNode implements ASTPattern
public @NonNull ASTVariableId getVarId() {
return Objects.requireNonNull(firstChild(ASTVariableId.class));
}
-
- void bumpParenDepth() {
- parenDepth++;
- }
-
- @Override
- @Experimental("Parenthesized patterns is a Java 20 Preview feature")
- public int getParenthesisDepth() {
- return parenDepth;
- }
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java
index 9b76fbb19f..52a5534764 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTUnnamedPattern.java
@@ -5,10 +5,8 @@
package net.sourceforge.pmd.lang.java.ast;
-import net.sourceforge.pmd.annotation.Experimental;
-
/**
- * An unnamed pattern, a Java 21 Preview language feature.
+ * An unnamed pattern, a Java 22 language feature.
*
*
*
@@ -16,9 +14,8 @@ import net.sourceforge.pmd.annotation.Experimental;
*
*
*
- * @see JEP 443: Unnamed patterns and variables (Preview) (Java 21)
+ * @see JEP 456: Unnamed Variables & Patterns (Java 22)
*/
-@Experimental("Unnamed patterns is a Java 21 Preview feature")
public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPattern {
ASTUnnamedPattern(int id) {
@@ -29,9 +26,4 @@ public final class ASTUnnamedPattern extends AbstractJavaNode implements ASTPatt
protected R acceptVisitor(JavaVisitor super P, ? extends R> visitor, P data) {
return visitor.visit(this, data);
}
-
- @Override
- public int getParenthesisDepth() {
- return 0;
- }
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java
index 5ed897d23a..e82aa68a37 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AstImplUtil.java
@@ -47,20 +47,4 @@ final class AstImplUtil {
((AbstractJavaExpr) expression).bumpParenDepth();
}
-
- /**
- * @deprecated Parenthesized patterns are only possible with Java 20 Preview and are removed with Java 21.
- */
- @Deprecated
- static void bumpParenDepth(ASTPattern pattern) {
- assert pattern instanceof ASTTypePattern
- || pattern instanceof ASTRecordPattern
- : pattern.getClass() + " doesn't have parenDepth attribute!";
-
- if (pattern instanceof ASTTypePattern) {
- ((ASTTypePattern) pattern).bumpParenDepth();
- } else if (pattern instanceof ASTRecordPattern) {
- ((ASTRecordPattern) pattern).bumpParenDepth();
- }
- }
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java
index 2b1267f9ee..aa9ae5a538 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/LanguageLevelChecker.java
@@ -18,7 +18,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTCastExpression;
import net.sourceforge.pmd.lang.java.ast.ASTCatchClause;
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall;
+import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTEnumDeclaration;
+import net.sourceforge.pmd.lang.java.ast.ASTExplicitConstructorInvocation;
import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement;
import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter;
import net.sourceforge.pmd.lang.java.ast.ASTGuard;
@@ -122,69 +124,32 @@ public class LanguageLevelChecker {
* They might be also be standardized.
*/
private enum PreviewFeature implements LanguageFeature {
- /**
- * Pattern matching for switch
- * @see JEP 406: Pattern Matching for switch (Preview) (Java 17)
- * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18)
- * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
- * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
- * @see JEP 441: Pattern Matching for switch (Java 21)
- */
- PATTERNS_IN_SWITCH_STATEMENTS(17, 20, true),
-
- /**
- * Part of pattern matching for switch
- * @see #PATTERNS_IN_SWITCH_STATEMENTS
- * @see JEP 406: Pattern Matching for switch (Preview) (Java 17)
- * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18)
- * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
- * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
- * @see JEP 441: Pattern Matching for switch (Java 21)
- */
- NULL_IN_SWITCH_CASES(17, 20, true),
-
- /**
- * Part of pattern matching for switch: Case refinement using "when"
- * @see #PATTERNS_IN_SWITCH_STATEMENTS
- * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
- * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
- * @see JEP 441: Pattern Matching for switch (Java 21)
- */
- CASE_REFINEMENT(19, 20, true),
-
- /**
- * Record patterns
- * @see JEP 405: Record Patterns (Preview) (Java 19)
- * @see JEP 432: Record Patterns (Second Preview) (Java 20)
- * @see JEP 440: Record Patterns (Java 21)
- */
- RECORD_PATTERNS(19, 20, true),
-
- /**
- * Record deconstruction patterns in for-each loops.
- * Note: support for this has been removed with Java 21 (JEP 440).
- * @see JEP 432: Record Patterns (Second Preview) (Java 20)
- * @see JEP 440: Record Patterns (Java 21)
- */
- DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false),
-
/**
* String Templates.
* @see JEP 430: String Templates (Preview) (Java 21)
+ * @see JEP 459: String Templates (Second Preview) (Java 22)
*/
- STRING_TEMPLATES(21, 21, false),
+ STRING_TEMPLATES(21, 22, false),
/**
- * Unnamed patterns and variables.
+ * Unnamed variables and patterns.
* @see JEP 443: Unnamed patterns and variables (Preview) (Java 21)
+ * @see JEP 456: Unnamed Variables & Patterns (Java 22)
*/
- UNNAMED_PATTERNS_AND_VARIABLES(21, 21, false),
+ UNNAMED_VARIABLES_AND_PATTERNS(21, 21, true),
/**
* Unnamed Classes and Instance Main Methods
* @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21)
+ * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22)
*/
- UNNAMED_CLASSES(21, 21, false),
+ UNNAMED_CLASSES(21, 22, false),
+
+ /**
+ * Statements before super
+ * @see JEP 447: Statements before super(...) (Preview) (Java 22)
+ */
+ STATEMENTS_BEFORE_SUPER(22, 22, false),
; // SUPPRESS CHECKSTYLE enum trailing semi is awesome
@@ -211,10 +176,10 @@ public class LanguageLevelChecker {
}
String message = StringUtils.capitalize(displayNameLower(name()));
- if (canBePreview) {
+ if (wasStandardized) {
+ message += " was only standardized in Java " + (maxPreviewVersion + 1);
+ } else if (canBePreview) {
message += " is a preview feature of JDK " + jdk;
- } else if (wasStandardized) {
- message = message + " was only standardized in Java " + (maxPreviewVersion + 1);
} else if (minPreviewVersion == maxPreviewVersion) {
message += " is a preview feature of JDK " + minPreviewVersion;
} else {
@@ -378,6 +343,44 @@ public class LanguageLevelChecker {
*/
SEALED_CLASSES(17),
+ /**
+ * Pattern matching for switch
+ * @see JEP 406: Pattern Matching for switch (Preview) (Java 17)
+ * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18)
+ * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
+ * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
+ * @see JEP 441: Pattern Matching for switch (Java 21)
+ */
+ PATTERNS_IN_SWITCH_STATEMENTS(21),
+
+ /**
+ * Part of pattern matching for switch
+ * @see #PATTERNS_IN_SWITCH_STATEMENTS
+ * @see JEP 406: Pattern Matching for switch (Preview) (Java 17)
+ * @see JEP 420: Pattern Matching for switch (Second Preview) (Java 18)
+ * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
+ * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
+ * @see JEP 441: Pattern Matching for switch (Java 21)
+ */
+ NULL_IN_SWITCH_CASES(21),
+
+ /**
+ * Part of pattern matching for switch: Case refinement using "when"
+ * @see #PATTERNS_IN_SWITCH_STATEMENTS
+ * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19)
+ * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20)
+ * @see JEP 441: Pattern Matching for switch (Java 21)
+ */
+ CASE_REFINEMENT(21),
+
+ /**
+ * Record patterns
+ * @see JEP 405: Record Patterns (Preview) (Java 19)
+ * @see JEP 432: Record Patterns (Second Preview) (Java 20)
+ * @see JEP 440: Record Patterns (Java 21)
+ */
+ RECORD_PATTERNS(21),
+
; // SUPPRESS CHECKSTYLE enum trailing semi is awesome
private final int minJdkLevel;
@@ -512,9 +515,6 @@ public class LanguageLevelChecker {
@Override
public Void visit(ASTForeachStatement node, T data) {
check(node, RegularLanguageFeature.FOREACH_LOOPS, data);
- if (node.getFirstChild() instanceof ASTRecordPattern) {
- check(node, PreviewFeature.DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data);
- }
return null;
}
@@ -578,13 +578,13 @@ public class LanguageLevelChecker {
@Override
public Void visit(ASTRecordPattern node, T data) {
- check(node, PreviewFeature.RECORD_PATTERNS, data);
+ check(node, RegularLanguageFeature.RECORD_PATTERNS, data);
return null;
}
@Override
public Void visit(ASTGuard node, T data) {
- check(node, PreviewFeature.CASE_REFINEMENT, data);
+ check(node, RegularLanguageFeature.CASE_REFINEMENT, data);
return null;
}
@@ -627,13 +627,13 @@ public class LanguageLevelChecker {
check(node, RegularLanguageFeature.COMPOSITE_CASE_LABEL, data);
}
if (node.isDefault() && JavaTokenKinds.CASE == node.getFirstToken().getKind()) {
- check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data);
+ check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data);
}
if (node.getFirstChild() instanceof ASTNullLiteral) {
- check(node, PreviewFeature.NULL_IN_SWITCH_CASES, data);
+ check(node, RegularLanguageFeature.NULL_IN_SWITCH_CASES, data);
}
if (node.getFirstChild() instanceof ASTPattern) {
- check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data);
+ check(node, RegularLanguageFeature.PATTERNS_IN_SWITCH_STATEMENTS, data);
}
return null;
}
@@ -664,7 +664,7 @@ public class LanguageLevelChecker {
@Override
public Void visit(ASTUnnamedPattern node, T data) {
- check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, data);
+ check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, data);
return null;
}
@@ -691,14 +691,25 @@ public class LanguageLevelChecker {
return null;
}
+ @Override
+ public Void visit(ASTConstructorDeclaration node, T data) {
+ super.visit(node, data);
+ if (node.getBody().descendants(ASTExplicitConstructorInvocation.class).nonEmpty()) {
+ if (!(node.getBody().getFirstChild() instanceof ASTExplicitConstructorInvocation)) {
+ check(node, PreviewFeature.STATEMENTS_BEFORE_SUPER, data);
+ }
+ }
+ return null;
+ }
+
private void checkIdent(JavaNode node, String simpleName, T acc) {
if ("enum".equals(simpleName)) {
check(node, Keywords.ENUM_AS_AN_IDENTIFIER, acc);
} else if ("assert".equals(simpleName)) {
check(node, Keywords.ASSERT_AS_AN_IDENTIFIER, acc);
} else if ("_".equals(simpleName)) {
- if (LanguageLevelChecker.this.preview) {
- check(node, PreviewFeature.UNNAMED_PATTERNS_AND_VARIABLES, acc);
+ if (LanguageLevelChecker.this.jdkVersion >= 21) {
+ check(node, PreviewFeature.UNNAMED_VARIABLES_AND_PATTERNS, acc);
} else {
check(node, Keywords.UNDERSCORE_AS_AN_IDENTIFIER, acc);
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java
index 00a92e335e..8992970ec6 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredRule.java
@@ -9,9 +9,6 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import net.sourceforge.pmd.lang.java.ast.ASTBodyDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
@@ -35,8 +32,6 @@ import net.sourceforge.pmd.util.CollectionUtil;
* @author Brian Remedios
*/
public class CommentRequiredRule extends AbstractJavaRulechainRule {
- private static final Logger LOG = LoggerFactory.getLogger(CommentRequiredRule.class);
-
// Used to pretty print a message
private static final Map DESCRIPTOR_NAME_TO_COMMENT_TYPE = new HashMap<>();
@@ -46,8 +41,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule {
private static final PropertyDescriptor OVERRIDE_CMT_DESCRIPTOR
= requirementPropertyBuilder("methodWithOverrideCommentRequirement", "Comments on @Override methods")
.defaultValue(CommentRequirement.Ignored).build();
- private static final PropertyDescriptor HEADER_CMT_REQUIREMENT_DESCRIPTOR
- = requirementPropertyBuilder("headerCommentRequirement", "Deprecated! Header comments. Please use the property \"classCommentRequired\" instead.").build();
private static final PropertyDescriptor CLASS_CMT_REQUIREMENT_DESCRIPTOR
= requirementPropertyBuilder("classCommentRequirement", "Class comments").build();
private static final PropertyDescriptor FIELD_CMT_REQUIREMENT_DESCRIPTOR
@@ -73,7 +66,6 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule {
definePropertyDescriptor(OVERRIDE_CMT_DESCRIPTOR);
definePropertyDescriptor(ACCESSOR_CMT_DESCRIPTOR);
definePropertyDescriptor(CLASS_CMT_REQUIREMENT_DESCRIPTOR);
- definePropertyDescriptor(HEADER_CMT_REQUIREMENT_DESCRIPTOR);
definePropertyDescriptor(FIELD_CMT_REQUIREMENT_DESCRIPTOR);
definePropertyDescriptor(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR);
definePropertyDescriptor(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR);
@@ -94,20 +86,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule {
getProperty(SERIAL_VERSION_UID_CMT_REQUIREMENT_DESCRIPTOR));
propertyValues.put(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR,
getProperty(SERIAL_PERSISTENT_FIELDS_CMT_REQUIREMENT_DESCRIPTOR));
-
- CommentRequirement headerCommentRequirementValue = getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR);
- boolean headerCommentRequirementValueOverridden = headerCommentRequirementValue != CommentRequirement.Required;
- CommentRequirement classCommentRequirementValue = getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR);
- boolean classCommentRequirementValueOverridden = classCommentRequirementValue != CommentRequirement.Required;
-
- if (headerCommentRequirementValueOverridden && !classCommentRequirementValueOverridden) {
- LOG.warn("Rule CommentRequired uses deprecated property 'headerCommentRequirement'. "
- + "Future versions of PMD will remove support for this property. "
- + "Please use 'classCommentRequirement' instead!");
- propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, headerCommentRequirementValue);
- } else {
- propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, classCommentRequirementValue);
- }
+ propertyValues.put(CLASS_CMT_REQUIREMENT_DESCRIPTOR, getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR));
}
private void checkCommentMeetsRequirement(Object data, JavadocCommentOwner node,
@@ -203,8 +182,7 @@ public class CommentRequiredRule extends AbstractJavaRulechainRule {
return getProperty(OVERRIDE_CMT_DESCRIPTOR) == CommentRequirement.Ignored
&& getProperty(ACCESSOR_CMT_DESCRIPTOR) == CommentRequirement.Ignored
- && (getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored
- || getProperty(HEADER_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored)
+ && getProperty(CLASS_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored
&& getProperty(FIELD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored
&& getProperty(PUB_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored
&& getProperty(PROT_METHOD_CMT_REQUIREMENT_DESCRIPTOR) == CommentRequirement.Ignored
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java
index 136a68799c..31e5c53f2f 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassRule.java
@@ -5,7 +5,6 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty;
-import static net.sourceforge.pmd.properties.PropertyFactory.stringProperty;
import java.io.Externalizable;
import java.io.ObjectInputStream;
@@ -45,8 +44,6 @@ import net.sourceforge.pmd.reporting.RuleContext;
// Note: This rule has been formerly known as "BeanMembersShouldSerialize".
public class NonSerializableClassRule extends AbstractJavaRulechainRule {
- private static final PropertyDescriptor PREFIX_DESCRIPTOR = stringProperty("prefix")
- .desc("deprecated! A variable prefix to skip, i.e., m_").defaultValue("").build();
private static final PropertyDescriptor CHECK_ABSTRACT_TYPES = booleanProperty("checkAbstractTypes")
.desc("Enable to verify fields with abstract types like abstract classes, interfaces, generic types "
+ "or java.lang.Object. Enabling this might lead to more false positives, since the concrete "
@@ -62,7 +59,6 @@ public class NonSerializableClassRule extends AbstractJavaRulechainRule {
public NonSerializableClassRule() {
super(ASTVariableId.class, ASTClassDeclaration.class, ASTEnumDeclaration.class,
ASTRecordDeclaration.class);
- definePropertyDescriptor(PREFIX_DESCRIPTOR);
definePropertyDescriptor(CHECK_ABSTRACT_TYPES);
}
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java
index ddfa812087..9589b49d11 100644
--- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java
+++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceRule.java
@@ -6,12 +6,15 @@ package net.sourceforge.pmd.lang.java.rule.errorprone;
import net.sourceforge.pmd.lang.ast.NodeStream;
import net.sourceforge.pmd.lang.ast.NodeStream.DescendantNodeStream;
+import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr;
+import net.sourceforge.pmd.lang.java.ast.ASTAssignmentExpression;
import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall;
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement;
import net.sourceforge.pmd.lang.java.ast.ASTVariableAccess;
import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils;
import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule;
+import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol;
public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechainRule {
@@ -37,6 +40,62 @@ public class SingletonClassReturningNewInstanceRule extends AbstractJavaRulechai
}
private boolean returnsLocalVariables(NodeStream returns) {
- return returns.children(ASTVariableAccess.class).filter(JavaAstUtils::isReferenceToLocal).nonEmpty();
+ return returns.children(ASTVariableAccess.class)
+ .filter(JavaAstUtils::isReferenceToLocal)
+ .filterNot(this::isDoubleAssignment)
+ .nonEmpty();
}
+
+ private boolean isDoubleAssignment(ASTVariableAccess variableAccess) {
+ // search in the whole method
+ return variableAccess.ancestors(ASTMethodDeclaration.class)
+ .descendants(ASTVariableAccess.class)
+ // for any writes
+ .filter(v -> v.getAccessType() == ASTAssignableExpr.AccessType.WRITE)
+ // to the same variable
+ .filter(v -> JavaAstUtils.isReferenceToSameVar(variableAccess, v))
+ // assignment from a constructor call (next sibling = right hand side) or another Assignment
+ .filter(v -> v.getNextSibling() instanceof ASTConstructorCall || v.getNextSibling() instanceof ASTAssignmentExpression)
+ // check for both variants
+ .filter(v -> {
+ boolean variant1 = false;
+ boolean variant2 = false;
+
+ // check variant 1: field = localVar = new Singleton()
+ if (v.getNextSibling() instanceof ASTConstructorCall) {
+ if (v.getParent() instanceof ASTAssignmentExpression && v.getParent().getParent() instanceof ASTAssignmentExpression) {
+ ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent().getParent();
+ ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getParent();
+
+ boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall;
+ boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment;
+ boolean leftIsField = false;
+ if (leftAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) {
+ JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) leftAssignment.getLeftOperand()).getReferencedSym();
+ leftIsField = symbol != null && symbol.isField();
+ }
+ variant1 = fromConstructor && fromRightToLeft && leftIsField;
+ }
+
+ // check variant 2: localVar = field = new Singleton()
+ } else if (v.getNextSibling() instanceof ASTAssignmentExpression) {
+ if (v.getParent() instanceof ASTAssignmentExpression) {
+ ASTAssignmentExpression leftAssignment = (ASTAssignmentExpression) v.getParent();
+ ASTAssignmentExpression rightAssignment = (ASTAssignmentExpression) v.getNextSibling();
+
+ boolean fromConstructor = rightAssignment.getRightOperand() instanceof ASTConstructorCall;
+ boolean fromRightToLeft = leftAssignment.getRightOperand() == rightAssignment;
+ boolean rightIsField = false;
+ if (rightAssignment.getLeftOperand() instanceof ASTAssignableExpr.ASTNamedReferenceExpr) {
+ JVariableSymbol symbol = ((ASTAssignableExpr.ASTNamedReferenceExpr) rightAssignment.getLeftOperand()).getReferencedSym();
+ rightIsField = symbol != null && symbol.isField();
+ }
+ variant2 = fromConstructor && fromRightToLeft && rightIsField;
+ }
+ }
+ return variant1 || variant2;
+ })
+ .nonEmpty();
+ }
+
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java
index 0484a8f315..eeb5bba886 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/BaseJavaTreeDumpTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java;
-import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest;
+import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
/**
* Special tweak of BaseTreeDumpTest to remove deprecated attributes
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java
similarity index 90%
rename from pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java
index e334d16371..f8be02dc22 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/ExcludeLinesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ExcludeLinesTest.java
@@ -2,14 +2,13 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.java;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.java.BaseParserTest;
import net.sourceforge.pmd.lang.java.ast.ASTVariableId;
import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule;
import net.sourceforge.pmd.lang.rule.Rule;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java
similarity index 96%
rename from pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java
index 8c16cc9e74..7875410bdd 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/FooRule.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/FooRule.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.java;
import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTVariableId;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java
index 4e598a9cef..fee672333d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java
@@ -11,7 +11,7 @@ import java.util.stream.Collectors;
import org.checkerframework.checker.nullness.qual.NonNull;
import net.sourceforge.pmd.lang.ast.Node;
-import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter;
+import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
import net.sourceforge.pmd.lang.java.ast.ASTExpression;
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTModifierList;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java
index 4655032327..cdf292b34f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaLanguageModuleTest.java
@@ -24,10 +24,10 @@ class JavaLanguageModuleTest {
@Test
void previewVersionShouldBeGreaterThanNonPreview() {
- LanguageVersion java20 = JavaLanguageModule.getInstance().getVersion("20");
- LanguageVersion java20p = JavaLanguageModule.getInstance().getVersion("20-preview");
+ LanguageVersion java = JavaLanguageModule.getInstance().getVersion("22");
+ LanguageVersion javaPreview = JavaLanguageModule.getInstance().getVersion("22-preview");
- assertTrue(java20p.compareTo(java20) > 0, "java20-preview should be greater than java20");
+ assertTrue(javaPreview.compareTo(java) > 0, "java-preview should be greater than java");
}
@Test
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java
index 0fd2359166..c5bcd3332e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaParsingHelper.java
@@ -24,7 +24,7 @@ import net.sourceforge.pmd.lang.LanguageProcessor;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.ast.SemanticErrorReporter;
import net.sourceforge.pmd.lang.ast.SemanticException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
import net.sourceforge.pmd.lang.java.ast.JavaParser;
import net.sourceforge.pmd.lang.java.internal.JavaAstProcessor;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java
similarity index 96%
rename from pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java
index 4b190e8689..77ff85c6c7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionDiscovererTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.java;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -11,11 +11,11 @@ import java.io.File;
import org.junit.jupiter.api.Test;
+import net.sourceforge.pmd.PMDConfiguration;
import net.sourceforge.pmd.lang.Language;
import net.sourceforge.pmd.lang.LanguageRegistry;
import net.sourceforge.pmd.lang.LanguageVersion;
import net.sourceforge.pmd.lang.LanguageVersionDiscoverer;
-import net.sourceforge.pmd.lang.java.JavaLanguageModule;
class LanguageVersionDiscovererTest {
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java
index 47f1619085..59d784aeec 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/LanguageVersionTest.java
@@ -4,13 +4,13 @@
package net.sourceforge.pmd.lang.java;
-import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs;
-import static net.sourceforge.pmd.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist;
+import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.defaultVersionIs;
+import static net.sourceforge.pmd.test.AbstractLanguageVersionTest.TestDescriptor.versionDoesNotExist;
import java.util.Arrays;
import java.util.Collection;
-import net.sourceforge.pmd.AbstractLanguageVersionTest;
+import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
import net.sourceforge.pmd.lang.Language;
class LanguageVersionTest extends AbstractLanguageVersionTest {
@@ -37,16 +37,17 @@ class LanguageVersionTest extends AbstractLanguageVersionTest {
new TestDescriptor(java, "18"),
new TestDescriptor(java, "19"),
new TestDescriptor(java, "20"),
- new TestDescriptor(java, "20-preview"),
new TestDescriptor(java, "21"),
new TestDescriptor(java, "21-preview"),
+ new TestDescriptor(java, "22"),
+ new TestDescriptor(java, "22-preview"),
- defaultVersionIs(java, "21"),
+ defaultVersionIs(java, "22"),
// this one won't be found: case-sensitive!
versionDoesNotExist("JAVA", "JAVA", "1.7"),
// not supported anymore
- versionDoesNotExist(java, "19-preview")
+ versionDoesNotExist(java, "20-preview")
);
}
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java
similarity index 97%
rename from pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java
index ff9265a678..5202134e26 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/coverage/PMDCoverageTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDCoverageTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.coverage;
+package net.sourceforge.pmd.lang.java;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
@@ -25,7 +25,6 @@ import net.sourceforge.pmd.PMDConfiguration;
import net.sourceforge.pmd.PmdAnalysis;
import net.sourceforge.pmd.internal.util.IOUtil;
import net.sourceforge.pmd.lang.LanguageVersion;
-import net.sourceforge.pmd.lang.java.JavaLanguageModule;
import com.github.stefanbirkner.systemlambda.SystemLambda;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java
similarity index 95%
rename from pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java
index b4d8e5a12c..268b850b11 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/PMDTaskTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.ant;
+package net.sourceforge.pmd.lang.java;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -14,10 +14,12 @@ import java.util.Locale;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.internal.util.IOUtil;
+import net.sourceforge.pmd.test.AbstractAntTestHelper;
class PMDTaskTest extends AbstractAntTestHelper {
PMDTaskTest() {
+ pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/java/ant/xml";
antTestScriptFilename = "pmdtasktest.xml";
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java
index 6f3d7e4f37..5fa5b76c2a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/QuickstartRulesetTest.java
@@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
+import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
import net.sourceforge.pmd.lang.rule.RuleSet;
import net.sourceforge.pmd.lang.rule.RuleSetLoader;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java
similarity index 91%
rename from pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java
rename to pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java
index f9bb61fdca..2e6befc748 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/ReportTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ReportTest.java
@@ -2,10 +2,10 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.java;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed;
import static org.junit.jupiter.api.Assertions.assertFalse;
import java.util.Optional;
@@ -13,7 +13,6 @@ import java.util.regex.Pattern;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.java.JavaParsingHelper;
import net.sourceforge.pmd.lang.rule.Rule;
import net.sourceforge.pmd.reporting.Report;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java
index eac601291e..7276d213b0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/RuleSetFactoryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java;
-import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
+import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
/**
* Test java's rulesets
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java
index 3c71089661..40a023f965 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/SuppressWarningsTest.java
@@ -4,12 +4,11 @@
package net.sourceforge.pmd.lang.java;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.FooRule;
import net.sourceforge.pmd.lang.java.ast.ASTClassDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java
index 850d2d5f90..cd1e20ef28 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/AllJavaAstTreeDumpTest.java
@@ -15,9 +15,10 @@ import org.junit.platform.suite.api.Suite;
Java15TreeDumpTest.class,
Java16TreeDumpTest.class,
Java17TreeDumpTest.class,
- Java20PreviewTreeDumpTest.class,
Java21TreeDumpTest.class,
- Java21PreviewTreeDumpTest.class
+ Java21PreviewTreeDumpTest.class,
+ Java22TreeDumpTest.class,
+ Java22PreviewTreeDumpTest.class
})
class AllJavaAstTreeDumpTest {
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java
index 45cb62715a..44516d5d53 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/JDKVersionTest.java
@@ -16,7 +16,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java
index 5100aaba9f..0e75ba10c1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java14TreeDumpTest.java
@@ -11,7 +11,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java
index 9b65df591e..c8ed83bde6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java15TreeDumpTest.java
@@ -9,7 +9,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java
index bd830313eb..16324eef76 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java16TreeDumpTest.java
@@ -18,7 +18,7 @@ import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.NodeStream;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
import net.sourceforge.pmd.lang.java.symbols.JElementSymbol;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java
index 64b7a127d7..e27c306f8e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java17TreeDumpTest.java
@@ -10,7 +10,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java
deleted file mode 100644
index fec894662d..0000000000
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-package net.sourceforge.pmd.lang.java.ast;
-
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import org.junit.jupiter.api.Test;
-
-import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
-import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
-import net.sourceforge.pmd.lang.java.JavaParsingHelper;
-
-class Java20PreviewTreeDumpTest extends BaseJavaTreeDumpTest {
- private final JavaParsingHelper java20p =
- JavaParsingHelper.DEFAULT.withDefaultVersion("20-preview")
- .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/");
- private final JavaParsingHelper java20 = java20p.withDefaultVersion("20");
-
- @Override
- public BaseParsingHelper, ?> getParser() {
- return java20p;
- }
-
- @Test
- void dealingWithNullBeforeJava20Preview() {
- ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java"));
- assertTrue(thrown.getMessage().contains("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly"),
- "Unexpected message: " + thrown.getMessage());
- }
-
- @Test
- void dealingWithNull() {
- doTest("DealingWithNull");
- }
-
- @Test
- void enhancedTypeCheckingSwitch() {
- doTest("EnhancedTypeCheckingSwitch");
- }
-
- @Test
- void exhaustiveSwitch() {
- doTest("ExhaustiveSwitch");
- }
-
- @Test
- void guardedAndParenthesizedPatternsBeforeJava20Preview() {
- ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedAndParenthesizedPatterns.java"));
- assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"),
- "Unexpected message: " + thrown.getMessage());
- }
-
- @Test
- void guardedAndParenthesizedPatterns() {
- doTest("GuardedAndParenthesizedPatterns");
- }
-
- @Test
- void patternsInSwitchLabelsBeforeJava20Preview() {
- ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java"));
- assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"),
- "Unexpected message: " + thrown.getMessage());
- }
-
- @Test
- void patternsInSwitchLabels() {
- doTest("PatternsInSwitchLabels");
- }
-
- @Test
- void refiningPatternsInSwitch() {
- doTest("RefiningPatternsInSwitch");
- }
-
- @Test
- void scopeOfPatternVariableDeclarations() {
- doTest("ScopeOfPatternVariableDeclarations");
- }
-
- @Test
- void recordPatterns() {
- doTest("RecordPatterns");
- }
-
- @Test
- void recordPatternsBeforeJava20Preview() {
- ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java"));
- assertTrue(thrown.getMessage().contains("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"),
- "Unexpected message: " + thrown.getMessage());
- }
-
- @Test
- void recordPatternsInEnhancedFor() {
- doTest("RecordPatternsInEnhancedFor");
- }
-
- @Test
- void recordPatternsInEnhancedForBeforeJava20Preview() {
- ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatternsInEnhancedFor.java"));
- assertTrue(thrown.getMessage().contains("Deconstruction patterns in enhanced for statement is a preview feature of JDK 20, you should select your language version accordingly"),
- "Unexpected message: " + thrown.getMessage());
- }
-
- @Test
- void recordPatternsExhaustiveSwitch() {
- doTest("RecordPatternsExhaustiveSwitch");
- }
-}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java
index 26c055469d..33919d1984 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21PreviewTreeDumpTest.java
@@ -15,11 +15,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol;
import net.sourceforge.pmd.lang.java.types.JTypeMirror;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
class Java21PreviewTreeDumpTest extends BaseJavaTreeDumpTest {
private final JavaParsingHelper java21p =
@@ -59,10 +59,7 @@ class Java21PreviewTreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void unnamedPatternsAndVariablesBeforeJava21Preview() {
ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables.java"));
- assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier"));
-
- thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep443_UnnamedPatternsAndVariables2.java"));
- assertThat(thrown.getMessage(), containsString("Unnamed patterns and variables is a preview feature of JDK 21, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly"));
}
@Test
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java
index 6ffde7d974..2dc7a4e1db 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java21TreeDumpTest.java
@@ -11,9 +11,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.ParseException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
private final JavaParsingHelper java21 =
@@ -34,7 +34,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void patternMatchingForSwitchBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep441_PatternMatchingForSwitch.java"));
- assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly"));
}
@Test
@@ -45,7 +45,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void dealingWithNullBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java"));
- assertThat(thrown.getMessage(), containsString("Null in switch cases is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Null in switch cases are a feature of Java 21, you should select your language version accordingly"));
}
@@ -67,7 +67,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void guardedPatternsBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedPatterns.java"));
- assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly"));
}
@Test
@@ -78,7 +78,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void patternsInSwitchLabelsBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java"));
- assertThat(thrown.getMessage(), containsString("Patterns in switch statements is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Patterns in switch statements are a feature of Java 21, you should select your language version accordingly"));
}
@Test
@@ -99,7 +99,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void recordPatternsJepBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("Jep440_RecordPatterns.java"));
- assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly"));
}
@Test
@@ -110,7 +110,7 @@ class Java21TreeDumpTest extends BaseJavaTreeDumpTest {
@Test
void recordPatternsBeforeJava21() {
ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatterns.java"));
- assertThat(thrown.getMessage(), containsString("Record patterns is a preview feature of JDK 20, you should select your language version accordingly"));
+ assertThat(thrown.getMessage(), containsString("Record patterns are a feature of Java 21, you should select your language version accordingly"));
}
@Test
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java
new file mode 100644
index 0000000000..5f46fd79fa
--- /dev/null
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22PreviewTreeDumpTest.java
@@ -0,0 +1,106 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+package net.sourceforge.pmd.lang.java.ast;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+
+import net.sourceforge.pmd.lang.ast.ParseException;
+import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
+import net.sourceforge.pmd.lang.java.JavaParsingHelper;
+import net.sourceforge.pmd.lang.java.symbols.JClassSymbol;
+import net.sourceforge.pmd.lang.java.types.JTypeMirror;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+
+class Java22PreviewTreeDumpTest extends BaseJavaTreeDumpTest {
+ private final JavaParsingHelper java22p =
+ JavaParsingHelper.DEFAULT.withDefaultVersion("22-preview")
+ .withResourceContext(Java22PreviewTreeDumpTest.class, "jdkversiontests/java22p/");
+ private final JavaParsingHelper java22 = java22p.withDefaultVersion("22");
+
+ @Override
+ public BaseParsingHelper, ?> getParser() {
+ return java22p;
+ }
+
+ @Test
+ void jep459TemplateProcessors() {
+ doTest("Jep459_StringTemplates");
+ }
+
+ @Test
+ void jep459TemplateProcessorsBeforeJava22Preview() {
+ ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep459_StringTemplates.java"));
+ assertThat(thrown.getMessage(), containsString("String templates is a preview feature of JDK 22, you should select your language version accordingly"));
+ }
+
+ @Test
+ void jep459TemplateExpressionType() {
+ ASTCompilationUnit unit = java22p.parse("class Foo {{ int i = 1; String s = STR.\"i = \\{i}\"; }}");
+ ASTTemplateExpression templateExpression = unit.descendants(ASTTemplateExpression.class).first();
+ JTypeMirror typeMirror = templateExpression.getTypeMirror();
+ assertEquals("java.lang.String", ((JClassSymbol) typeMirror.getSymbol()).getCanonicalName());
+ }
+
+ @Test
+ void jep463UnnamedClasses1() {
+ doTest("Jep463_UnnamedClasses1");
+ ASTCompilationUnit compilationUnit = java22p.parseResource("Jep463_UnnamedClasses1.java");
+ assertTrue(compilationUnit.isUnnamedClass());
+ ASTMethodCall methodCall = compilationUnit.descendants(ASTMethodCall.class).first();
+ assertNotNull(methodCall.getTypeMirror());
+ }
+
+ @Test
+ void jep463UnnamedClasses2() {
+ doTest("Jep463_UnnamedClasses2");
+ }
+
+ @Test
+ void jep463UnnamedClasses3() {
+ doTest("Jep463_UnnamedClasses3");
+ }
+
+ @Test
+ void jep463UnnamedClasses4WithImports() {
+ doTest("Jep463_UnnamedClasses4WithImports");
+ }
+
+ @Test
+ void jep463UnnamedClassesBeforeJava22Preview() {
+ ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep463_UnnamedClasses1.java"));
+ assertThat(thrown.getMessage(), containsString("Unnamed classes is a preview feature of JDK 22, you should select your language version accordingly"));
+ }
+
+ @Test
+ void jep463TestOrdinaryCompilationUnit() {
+ ASTCompilationUnit compilationUnit = java22.parse("public class Foo { public static void main(String[] args) {}}");
+ assertFalse(compilationUnit.isUnnamedClass());
+ }
+
+ @Test
+ void jep463TestModularCompilationUnit() {
+ ASTCompilationUnit compilationUnit = java22.parse("module foo {}");
+ assertFalse(compilationUnit.isUnnamedClass());
+ }
+
+ @Test
+ void jep447StatementsBeforeSuper() {
+ doTest("Jep447_StatementsBeforeSuper");
+ }
+
+ @Test
+ void jep447StatementsBeforeSuperBeforeJava22Preview() {
+ ParseException thrown = assertThrows(ParseException.class, () -> java22.parseResource("Jep447_StatementsBeforeSuper.java"));
+ assertThat(thrown.getMessage(), containsString("Statements before super is a preview feature of JDK 22, you should select your language version accordingly"));
+ }
+}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java
new file mode 100644
index 0000000000..acd9a99137
--- /dev/null
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java22TreeDumpTest.java
@@ -0,0 +1,46 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+package net.sourceforge.pmd.lang.java.ast;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import org.junit.jupiter.api.Test;
+
+import net.sourceforge.pmd.lang.ast.ParseException;
+import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
+import net.sourceforge.pmd.lang.java.JavaParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+
+class Java22TreeDumpTest extends BaseJavaTreeDumpTest {
+ private final JavaParsingHelper java22 =
+ JavaParsingHelper.DEFAULT.withDefaultVersion("22")
+ .withResourceContext(Java21TreeDumpTest.class, "jdkversiontests/java22/");
+ private final JavaParsingHelper java21 = java22.withDefaultVersion("21");
+ private final JavaParsingHelper java17 = java22.withDefaultVersion("17");
+
+ @Override
+ public BaseParsingHelper, ?> getParser() {
+ return java22;
+ }
+
+ @Test
+ void jep456UnnamedPatternsAndVariables() {
+ doTest("Jep456_UnnamedPatternsAndVariables");
+ }
+
+ @Test
+ void jep456UnnamedPatternsAndVariablesBeforeJava22() {
+ ParseException thrown = assertThrows(ParseException.class, () -> java21.parseResource("Jep456_UnnamedPatternsAndVariables.java"));
+ assertThat(thrown.getMessage(), containsString("Unnamed variables and patterns was only standardized in Java 22, you should select your language version accordingly"));
+ }
+
+ @Test
+ void jep456UnnamedVariablesAndPatternsUnderscoreBeforeJava21() {
+ ParseException thrown = assertThrows(ParseException.class, () -> java17.parse("class Test { { for(Integer _ : java.util.Arrays.asList(1, 2, 3)) {} } }"));
+ assertThat(thrown.getMessage(), containsString("Since Java 9, '_' is reserved and cannot be used as an identifier"));
+ }
+}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java
index b8c8522d76..b29dab3f0a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java9TreeDumpTest.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java
index 8ebb9fde3c..69f4fd13b7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ParserCornersTest.java
@@ -20,7 +20,7 @@ import org.junit.jupiter.api.Timeout;
import net.sourceforge.pmd.lang.ast.ParseException;
import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.document.FileId;
import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java
index 2e287f4efe..935b7c6b3c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/cpd/JavaCpdLexerTest.java
@@ -12,8 +12,8 @@ import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
import net.sourceforge.pmd.cpd.CpdLexer;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
-import net.sourceforge.pmd.cpd.test.LanguagePropertyConfig;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
import net.sourceforge.pmd.lang.ast.LexException;
import net.sourceforge.pmd.lang.document.FileId;
import net.sourceforge.pmd.lang.document.TextDocument;
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java
index bedece59e4..b227d27b90 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/AllMetricsTest.java
@@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration;
import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil;
-import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
+import net.sourceforge.pmd.test.SimpleAggregatorTst;
/**
* Executes the metrics testing rules.
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java
index f03e625677..bc5ac8e1e7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaDoubleMetricTestRule.java
@@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration;
import net.sourceforge.pmd.lang.metrics.Metric;
-import net.sourceforge.pmd.test.AbstractMetricTestRule;
+import net.sourceforge.pmd.lang.test.AbstractMetricTestRule;
/**
*
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java
index e4d2348417..f566c58340 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/JavaIntMetricTestRule.java
@@ -8,7 +8,7 @@ import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration;
import net.sourceforge.pmd.lang.metrics.Metric;
-import net.sourceforge.pmd.test.AbstractMetricTestRule;
+import net.sourceforge.pmd.lang.test.AbstractMetricTestRule;
/**
*
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java
index 80850a2795..73dc04513f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/metrics/impl/NPathTestRule.java
@@ -8,7 +8,7 @@ import java.math.BigInteger;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.metrics.JavaMetrics;
-import net.sourceforge.pmd.test.AbstractMetricTestRule;
+import net.sourceforge.pmd.lang.test.AbstractMetricTestRule;
/**
* @author Clément Fournier
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java
index b319c5e9f1..f1d3e1eb28 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AbstractClassWithoutAbstractMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AbstractClassWithoutAbstractMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java
index 1c922fd22e..b4818807f8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorClassGenerationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AccessorClassGenerationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java
index 7ef92f4c8e..a4bff3af89 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AccessorMethodGenerationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AccessorMethodGenerationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java
index 0fba328ac6..9df0a31644 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ArrayIsStoredDirectlyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ArrayIsStoredDirectlyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java
index df4543674d..1403fe41f3 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidMessageDigestFieldTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidMessageDigestFieldTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java
index 436d56f150..c3c2d9a56e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidPrintStackTraceTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidPrintStackTraceTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java
index 25ab862bfe..67fd392bde 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningCatchVariablesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidReassigningCatchVariablesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java
index a15f9742fb..b7deb6616c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningLoopVariablesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidReassigningLoopVariablesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java
index 68ab080b7d..aa1eecf167 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidReassigningParametersTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidReassigningParametersTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java
index 1b1e7898cf..7f1b4a2e16 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidStringBufferFieldTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidStringBufferFieldTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java
index 82d84a3c05..fe7b0ce420 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/AvoidUsingHardCodedIPTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidUsingHardCodedIPTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java
index cba377fd59..8699d4134d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/CheckResultSetTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CheckResultSetTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java
index bf685f3ad7..c81183b7b6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ConstantsInInterfaceTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConstantsInInterfaceTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java
index 1a407779e8..b316a1881f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DefaultLabelNotLastInSwitchStmtTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DefaultLabelNotLastInSwitchStmtTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java
index 26eee695b6..8a6947126a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/DoubleBraceInitializationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoubleBraceInitializationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java
index e0b774b80d..771debeb16 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopCanBeForeachTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ForLoopCanBeForeachTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java
index 5843550a3a..059c71f39d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ForLoopVariableCountTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ForLoopVariableCountTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java
index 84dce65d9c..5a1979c853 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/GuardLogStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class GuardLogStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java
index dc2c92f4ae..2765a69ce2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4SuitesShouldUseSuiteAnnotationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnit4SuitesShouldUseSuiteAnnotationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java
index 341829e928..ea6070f9e3 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseAfterAnnotationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnit4TestShouldUseAfterAnnotationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java
index b92ab68100..d32f7a5087 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseBeforeAnnotationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnit4TestShouldUseBeforeAnnotationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java
index 6710c145be..15b507dafb 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit4TestShouldUseTestAnnotationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnit4TestShouldUseTestAnnotationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java
index bf8190b559..d39a19249b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnit5TestShouldBePackagePrivateTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnit5TestShouldBePackagePrivateTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java
index 239cce7659..e77dd78150 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitAssertionsShouldIncludeMessageTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitAssertionsShouldIncludeMessageTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java
index c91e0ec567..30404275d4 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestContainsTooManyAssertsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitTestContainsTooManyAssertsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java
index b638b6931a..933f3f612c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitTestsShouldIncludeAssertTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitTestsShouldIncludeAssertTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java
index fccdcb4321..3ad1c36784 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/JUnitUseExpectedTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitUseExpectedTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java
index ad573713aa..a5720ad7f7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LiteralsFirstInComparisonsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LiteralsFirstInComparisonsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java
index 2d702101d4..5578b24fd5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/LooseCouplingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LooseCouplingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java
index 4ac38bd990..f3646e5d54 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MethodReturnsInternalArrayTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MethodReturnsInternalArrayTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java
index 0d374f3810..fd9b847b62 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/MissingOverrideTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MissingOverrideTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java
index 84c2a6d5b5..8c21b1715c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/OneDeclarationPerLineTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class OneDeclarationPerLineTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java
index 3ee1e1f9ec..56e4f6de8b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PreserveStackTraceTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class PreserveStackTraceTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java
index c4c4242233..6e656beb8e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/PrimitiveWrapperInstantiationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class PrimitiveWrapperInstantiationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java
index ae43342146..125b827b3a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceEnumerationWithIteratorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ReplaceEnumerationWithIteratorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java
index 96c695b7d9..32a5a7d682 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceHashtableWithMapTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ReplaceHashtableWithMapTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java
index 6e6c42ebfa..ef8f827443 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/ReplaceVectorWithListTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ReplaceVectorWithListTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java
index 4e8f183411..3d40f44bd2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SimplifiableTestAssertionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimplifiableTestAssertionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java
index c1e3024e73..1e413f1bde 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SwitchStmtsShouldHaveDefaultTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SwitchStmtsShouldHaveDefaultTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java
index f56c1d553a..eb401c15bc 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/SystemPrintlnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SystemPrintlnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java
index e0268e6b19..0401dd83ec 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedAssignmentTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedAssignmentTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java
index 1498848b13..d50db5eed9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedFormalParameterTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedFormalParameterTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java
index cef06f1d28..e036436f04 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedLocalVariableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java
index 2dbebb0d75..393832d452 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateFieldTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedPrivateFieldTest extends PmdRuleTst {
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java
index 95c69992cb..a865a70706 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedPrivateMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedPrivateMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java
index c5ff68ec34..59f03df249 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseCollectionIsEmptyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseCollectionIsEmptyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java
index 9ca82a74bf..aca984101e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseStandardCharsetsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseStandardCharsetsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java
index 6ae963e5b7..07334453bd 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseTryWithResourcesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseTryWithResourcesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java
index d427a9b63a..d3c6b35411 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UseVarargsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseVarargsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java
index c123e41fb9..4fe2c32ef5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/bestpractices/WhileLoopWithLiteralBooleanTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class WhileLoopWithLiteralBooleanTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java
index a01faa8ee8..0016e9ddbc 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AtLeastOneConstructorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AtLeastOneConstructorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java
index 3912331a26..34a6e215bb 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidDollarSignsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidDollarSignsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java
index 6f12fef002..f7776cd225 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedFieldInFinalClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidProtectedFieldInFinalClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java
index 26f19cbefb..7d7e2cfa3b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidProtectedMethodInFinalClassNotExtendingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidProtectedMethodInFinalClassNotExtendingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java
index d6be3157ba..fae466967b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/AvoidUsingNativeCodeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidUsingNativeCodeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java
index 4ecd11cdae..1b239e2ab1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/BooleanGetMethodNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class BooleanGetMethodNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java
index c1df93ea1c..34310381de 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CallSuperInConstructorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CallSuperInConstructorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java
index 32796e3fd4..ca721c867a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ClassNamingConventionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ClassNamingConventionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java
index 57e297e29a..c6e02b62f5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/CommentDefaultAccessModifierTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CommentDefaultAccessModifierTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java
index 383ded2194..ed559d2e32 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ConfusingTernaryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConfusingTernaryTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java
index 02ba0a4103..c94aed935c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ControlStatementBracesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ControlStatementBracesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java
index 70bbcd8897..4cb1a84298 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyControlStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EmptyControlStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java
index 44de194856..27bb5620d1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/EmptyMethodInAbstractClassShouldBeAbstractTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EmptyMethodInAbstractClassShouldBeAbstractTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java
index a5b01cc926..6e66ca54e4 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ExtendsObjectTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ExtendsObjectTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java
index 2a46f0ccc8..f1c9cfcb91 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldDeclarationsShouldBeAtStartOfClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FieldDeclarationsShouldBeAtStartOfClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java
index ad43201f57..e4a1157bf2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FieldNamingConventionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FieldNamingConventionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java
index 68a325445b..8efa889742 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FinalParameterInAbstractMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalParameterInAbstractMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java
index 0e77ed8483..427e066be8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ForLoopShouldBeWhileLoopTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ForLoopShouldBeWhileLoopTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java
index 16f76366c5..2327c1cd2f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/FormalParameterNamingConventionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FormalParameterNamingConventionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java
index 1408b7f3f2..4ed583d9fe 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/GenericsNamingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class GenericsNamingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java
index 9b306eb379..87875e0f14 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/IdenticalCatchBranchesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class IdenticalCatchBranchesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java
index 2535e6a9a0..fd1466df70 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LinguisticNamingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LinguisticNamingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java
index 8f9adcc264..04fdee75ab 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalHomeNamingConventionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LocalHomeNamingConventionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java
index ff39a550b0..ff119c1a28 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalInterfaceSessionNamingConventionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LocalInterfaceSessionNamingConventionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java
index 610f44eecd..5c49860210 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LocalVariableCouldBeFinalTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java
index 103742c709..18753981b9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableNamingConventionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LocalVariableNamingConventionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java
index f93806cc6a..86ad669aac 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/LongVariableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LongVariableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java
index 5a9477e98e..5104b29ffc 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MDBAndSessionBeanNamingConventionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MDBAndSessionBeanNamingConventionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java
index 589830413c..55d4325665 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MethodArgumentCouldBeFinalTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java
index eaa4fde1e9..67a7557ec0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodNamingConventionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MethodNamingConventionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java
index df3821dc03..80badeb38c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/NoPackageTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NoPackageTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java
index 9cd086b1e5..bf2e0d75eb 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/OnlyOneReturnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class OnlyOneReturnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java
index cdd036a17d..f82f7071ce 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PackageCaseTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class PackageCaseTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java
index 16f56fc61a..7449842bd8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/PrematureDeclarationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class PrematureDeclarationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java
index 6985386725..99b7caad86 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteInterfaceNamingConventionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class RemoteInterfaceNamingConventionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java
index 5e95b5525f..8c9a2dba9c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/RemoteSessionInterfaceNamingConventionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class RemoteSessionInterfaceNamingConventionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java
index c4ae1aff0d..cc08d111d9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortClassNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ShortClassNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java
index 9fab5587dc..77f1793eca 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortMethodNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ShortMethodNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java
index b178ba1bf7..e505d0ef49 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/ShortVariableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ShortVariableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java
index ae659dcfdc..6346aa9a48 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/TooManyStaticImportsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class TooManyStaticImportsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java
index 75d06a7980..051a52d508 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryAnnotationValueElementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryAnnotationValueElementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java
index 09e83074a5..bb37cb806f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryBoxingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java
index b479fdfa98..ddbca59128 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryCastTest.java
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryCastTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java
index 4e0c2bf4b7..b5111c5bb4 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryConstructorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryConstructorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java
index b8edf924a3..9f0c2eec0f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryFullyQualifiedNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryFullyQualifiedNameTest extends PmdRuleTst {
// Do not delete these two enums - it is needed for a test case
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java
index 4cdbf50000..ea4bea97d4 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryImportTest extends PmdRuleTst {
// these 2 methods are used for a test case, do not delete
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java
index d6fe2b3a65..10bf3efae5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryLocalBeforeReturnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryLocalBeforeReturnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java
index 442d89734b..5c77459d42 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryModifierTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryModifierTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java
index de89b09b55..9213d7d9f2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryReturnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryReturnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java
index 6258d531d9..9e488c285c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessarySemicolonTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessarySemicolonTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java
index fe6f6c19b4..3148d3a690 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseDiamondOperatorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseDiamondOperatorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java
index e535efd39c..506bbd7095 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseExplicitTypesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseExplicitTypesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java
index 28959ae4c0..a4cec59f39 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseShortArrayInitializerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseShortArrayInitializerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java
index df002dba91..71098101c0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UseUnderscoresInNumericLiteralsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseUnderscoresInNumericLiteralsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java
index 2ff2cb875e..8e4050c9aa 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessParenthesesTest.java
@@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.java.JavaParsingHelper;
import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit;
import net.sourceforge.pmd.lang.java.ast.ASTExpression;
import net.sourceforge.pmd.lang.java.rule.codestyle.UselessParenthesesRule.Necessity;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UselessParenthesesTest extends PmdRuleTst {
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java
index d4c28d5193..c7eed79cee 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/codestyle/UselessQualifiedThisTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UselessQualifiedThisTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java
index 2707edc916..a5d9253ee2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AbstractClassWithoutAnyMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AbstractClassWithoutAnyMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java
index 9014238a7b..32fecf59f8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidCatchingGenericExceptionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidCatchingGenericExceptionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java
index ffeb2eff0b..28eab0fdf1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidDeeplyNestedIfStmtsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidDeeplyNestedIfStmtsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java
index 8b4946aba8..aa3bbd57ba 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidRethrowingExceptionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidRethrowingExceptionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java
index 80992fa8b8..14e7a6b7df 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNewInstanceOfSameExceptionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidThrowingNewInstanceOfSameExceptionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java
index 47eace4526..c1b437ab41 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingNullPointerExceptionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidThrowingNullPointerExceptionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java
index be27cc8e00..8cffad6aeb 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidThrowingRawExceptionTypesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidThrowingRawExceptionTypesTest extends PmdRuleTst {
public static class Throwable extends java.lang.Throwable {
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java
index 0a18773aa2..146b4990f3 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/AvoidUncheckedExceptionsInSignaturesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidUncheckedExceptionsInSignaturesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java
index 5310503f78..7328a0999f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ClassWithOnlyPrivateConstructorsShouldBeFinalTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ClassWithOnlyPrivateConstructorsShouldBeFinalTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java
index c6c2edcebc..b20c1035a8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CognitiveComplexityTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CognitiveComplexityTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java
index 3f13ce5287..44d831ea9e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CollapsibleIfStatementsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CollapsibleIfStatementsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java
index 7c2948ec32..79ab664ae7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CouplingBetweenObjectsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CouplingBetweenObjectsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java
index df859e7e08..7833abbb86 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/CyclomaticComplexityTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CyclomaticComplexityTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java
index af2152f439..6a7cccfdd9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DataClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DataClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java
index e5d9b7b301..57280be3f8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/DoNotExtendJavaLangErrorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotExtendJavaLangErrorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java
index 292fde945d..2dbd142d27 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExceptionAsFlowControlTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ExceptionAsFlowControlTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java
index 74fd72a16c..7547ce785a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveImportsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ExcessiveImportsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java
index 6308b1fe4f..30fa157b94 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ExcessiveParameterListTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java
index 760e4807fe..7417e82f49 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ExcessivePublicCountTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ExcessivePublicCountTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java
index cf9d950639..71b86c4014 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/FinalFieldCouldBeStaticTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalFieldCouldBeStaticTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java
index dd69734923..eac3f10322 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/GodClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class GodClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java
index b974fad282..eb0972d72b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/ImmutableFieldTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ImmutableFieldTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java
index dc8c949263..f50fbe1971 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/InvalidJavaBeanTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
public class InvalidJavaBeanTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java
index 99e77ad459..b4e94a6e26 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LawOfDemeterTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LawOfDemeterTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java
index 3a4cb92739..b59044573a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LogicInversionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LogicInversionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java
index 00e0b010c9..b838934226 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/LoosePackageCouplingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class LoosePackageCouplingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java
index cb5e29d512..df946baa86 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/MutableStaticStateTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MutableStaticStateTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java
index 98ddc7cae6..f23536ba55 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NPathComplexityTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NPathComplexityTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java
index 48e984d9ad..537485d26c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/NcssCountTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NcssCountTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java
index d44e58ec86..d5e0bc20af 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SignatureDeclareThrowsExceptionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SignatureDeclareThrowsExceptionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java
index 3f2a8a5daf..dc68ac28bd 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifiedTernaryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimplifiedTernaryTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java
index 0b1a4bc204..f17434579f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanExpressionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimplifyBooleanExpressionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java
index ab631f2194..e385db5af1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyBooleanReturnsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimplifyBooleanReturnsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java
index 47400d35cf..9ad90e779d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SimplifyConditionalTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimplifyConditionalTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java
index 95fd5ff04c..81835c7c5b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SingularFieldTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java
index 588ab69e8d..20788f1419 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/SwitchDensityTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SwitchDensityTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java
index 05933e2507..9c3c33d7ee 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyFieldsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class TooManyFieldsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java
index 122519449a..fa9d3db763 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/TooManyMethodsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class TooManyMethodsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java
index 9a397a435a..fc4a699a0d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseObjectForClearerAPITest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseObjectForClearerAPITest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java
index 41ff6bd799..7d023149da 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UseUtilityClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseUtilityClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java
index 85ff3df3d9..ead57712d1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/design/UselessOverridingMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.design;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UselessOverridingMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java
index 322a64200a..9ecdfb0ba9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentContentTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.documentation;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CommentContentTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java
index 4c026b25c3..b3f976c2a9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentRequiredTest.java
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.rule.Rule;
import net.sourceforge.pmd.properties.PropertyDescriptor;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CommentRequiredTest extends PmdRuleTst {
@Test
@@ -23,9 +23,6 @@ class CommentRequiredTest extends PmdRuleTst {
assertNull(rule.dysfunctionReason(), "By default, the rule should be functional");
List> propertyDescriptors = getProperties(rule);
- // remove deprecated properties
- propertyDescriptors.removeIf(property -> property.description().startsWith("Deprecated!"));
-
for (PropertyDescriptor> property : propertyDescriptors) {
setPropertyValue(rule, property, "Ignored");
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java
index 5d4e204836..5c7b46c604 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/CommentSizeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.documentation;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CommentSizeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java
index 0bb603709c..07db696d06 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyConstructorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.documentation;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UncommentedEmptyConstructorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java
index 8c2095d737..cf02536ff6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/documentation/UncommentedEmptyMethodBodyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.documentation;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UncommentedEmptyMethodBodyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java
index 4edf718a2d..bcc9a1a047 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentInOperandTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AssignmentInOperandTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java
index 4813dfffbc..a0ec733db1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AssignmentToNonFinalStaticTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AssignmentToNonFinalStaticTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java
index 03bde11b12..299773b485 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAccessibilityAlterationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidAccessibilityAlterationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java
index 886c08b67d..2181e84e4b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidAssertAsIdentifierTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidAssertAsIdentifierTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java
index 191b68987d..e220e19d13 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidBranchingStatementAsLastInLoopTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidBranchingStatementAsLastInLoopTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java
index 246bce0db7..d677bbb03e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCallingFinalizeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidCallingFinalizeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java
index 006cc3d84e..b232a83d67 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingNPETest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidCatchingNPETest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java
index c11ea40e2a..c8a5c0c84d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidCatchingThrowableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidCatchingThrowableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java
index 267bb84ab9..89ea4cb63c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDecimalLiteralsInBigDecimalConstructorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidDecimalLiteralsInBigDecimalConstructorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java
index d2f660a2e9..c08bad740b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidDuplicateLiteralsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidDuplicateLiteralsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java
index be57423730..8b6da14263 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidEnumAsIdentifierTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidEnumAsIdentifierTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java
index f8486d435e..9cea99c577 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingMethodNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidFieldNameMatchingMethodNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java
index 3edcfcf304..3583b1a557 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidFieldNameMatchingTypeNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidFieldNameMatchingTypeNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java
index 68b781f08a..a839a4c68a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidInstanceofChecksInCatchClauseTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidInstanceofChecksInCatchClauseTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java
index 802b8dca59..d2a8f2c42b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLiteralsInIfConditionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidLiteralsInIfConditionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java
index d31247dec4..e1cdd89895 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidLosingExceptionInformationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidLosingExceptionInformationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java
index 68121b5dc5..3d2893f02c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidMultipleUnaryOperatorsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidMultipleUnaryOperatorsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java
index 968d7ca76b..9b396d1519 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/AvoidUsingOctalValuesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidUsingOctalValuesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java
index 2b1ba4ff7e..bf48e3784a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/BrokenNullCheckTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class BrokenNullCheckTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java
index 311a13ff74..930906b275 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperFirstTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CallSuperFirstTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java
index a368b2bc75..c9102640ca 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CallSuperLastTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CallSuperLastTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java
index 55bb58982b..26fc541489 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CheckSkipResultTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CheckSkipResultTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java
index dfd5d2066f..502cf5ea4f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ClassCastExceptionWithToArrayTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ClassCastExceptionWithToArrayTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java
index 2a96cb6855..371d240c06 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustBePublicTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CloneMethodMustBePublicTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java
index 9aef788c64..3f37f37eaf 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodMustImplementCloneableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CloneMethodMustImplementCloneableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java
index 717ac81df4..63df372d7a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloneMethodReturnTypeMustMatchClassNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CloneMethodReturnTypeMustMatchClassNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java
index bdbf15e7c2..20856ab956 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CloseResourceTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java
index 05acb24255..25e111a8fa 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/CompareObjectsWithEqualsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class CompareObjectsWithEqualsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java
index 723d440e4c..1015af42ed 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ComparisonWithNaNTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ComparisonWithNaNTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java
index 2440994922..8420a865ab 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ConstructorCallsOverridableMethodTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConstructorCallsOverridableMethodTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java
index 74a15e36ae..f2def6539a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DetachedTestCaseTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DetachedTestCaseTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java
index 4796425f69..46202e927a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotCallGarbageCollectionExplicitlyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotCallGarbageCollectionExplicitlyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java
index 7e5494958d..6a849194f6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotExtendJavaLangThrowableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotExtendJavaLangThrowableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java
index dd4a99f308..bdfd5d58cb 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotHardCodeSDCardTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotHardCodeSDCardTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java
index f6cc3a8bb1..dcb0f8f4ee 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotTerminateVMTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotTerminateVMTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java
index aed669dc83..7eefe57ee0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DoNotThrowExceptionInFinallyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotThrowExceptionInFinallyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java
index 1498a6db2a..f4c0ae4184 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontImportSunTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DontImportSunTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java
index eedf01e2d5..1572170e72 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/DontUseFloatTypeForLoopIndicesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DontUseFloatTypeForLoopIndicesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java
index a953c3e013..9a5537230b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyCatchBlockTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EmptyCatchBlockTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java
index 6f7cd4674f..cd31622ab2 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EmptyFinalizerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EmptyFinalizerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java
index fc903ce4bb..f0cfd64e5c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/EqualsNullTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EqualsNullTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java
index a8de36f386..d1747d4885 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeDoesNotCallSuperFinalizeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalizeDoesNotCallSuperFinalizeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java
index f94cb50b83..7da75fa5c1 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOnlyCallsSuperFinalizeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalizeOnlyCallsSuperFinalizeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java
index 9df63b451b..c529f24a4a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeOverloadedTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalizeOverloadedTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java
index ddc8e610b3..e2cab4ed1a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/FinalizeShouldBeProtectedTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class FinalizeShouldBeProtectedTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java
index b636426e8d..424df37768 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/IdempotentOperationsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class IdempotentOperationsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java
index 99ad4868f7..3a14a27009 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ImplicitSwitchFallThroughTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ImplicitSwitchFallThroughTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java
index c85239d5ea..f575d90629 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InstantiationToGetClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InstantiationToGetClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java
index 7e9abea98c..933231b1bc 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/InvalidLogMessageFormatTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InvalidLogMessageFormatTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java
index 047f7313e3..faaffea06c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitSpellingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitSpellingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java
index 6d7a5b846d..858cc27ba4 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JUnitStaticSuiteTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JUnitStaticSuiteTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java
index db5032bbfa..ac16e6555e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/JumbledIncrementerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class JumbledIncrementerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java
index 386383efd1..fe78042cbf 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MethodWithSameNameAsEnclosingClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MethodWithSameNameAsEnclosingClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java
index ca68722bec..3f5c5a0106 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MisplacedNullCheckTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MisplacedNullCheckTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java
index a7358da129..bb338c5969 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingSerialVersionUIDTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MissingSerialVersionUIDTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java
index 5cf642ed8e..cadf17f5f9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MissingStaticMethodInNonInstantiatableClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MissingStaticMethodInNonInstantiatableClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java
index f1deb552a7..fedc2ed326 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/MoreThanOneLoggerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class MoreThanOneLoggerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java
index d19b90912d..9d914a9552 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonCaseLabelInSwitchStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NonCaseLabelInSwitchStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java
index 9fc73d7ba0..5cc867bdb8 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonSerializableClassTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NonSerializableClassTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java
index 543bd5d56c..a971ea77c3 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NonStaticInitializerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NonStaticInitializerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java
index 84845a7d57..140df2e813 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/NullAssignmentTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NullAssignmentTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java
index bed7dd18c3..7611bfaa34 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/OverrideBothEqualsAndHashcodeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class OverrideBothEqualsAndHashcodeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java
index caf7485fac..a6f9bbe99a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperCloneImplementationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ProperCloneImplementationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java
index e301881e75..602ad8bdd5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ProperLoggerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ProperLoggerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java
index 88dc7a7593..499e6d6728 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnEmptyCollectionRatherThanNullTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ReturnEmptyCollectionRatherThanNullTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java
index 3a53638de2..b3e87a6011 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/ReturnFromFinallyBlockTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ReturnFromFinallyBlockTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java
index efe247e0c8..51199fb499 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SimpleDateFormatNeedsLocaleTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SimpleDateFormatNeedsLocaleTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java
index ff818721ae..e77ffe6cb0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingleMethodSingletonTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SingleMethodSingletonTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java
index 838a2b4cd6..2b178c9b72 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SingletonClassReturningNewInstanceTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SingletonClassReturningNewInstanceTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java
index cfabdd6c67..0b3916d131 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StaticEJBFieldShouldBeFinalTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class StaticEJBFieldShouldBeFinalTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java
index 60250e0167..f33dfcfd38 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/StringBufferInstantiationWithCharTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class StringBufferInstantiationWithCharTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java
index 9536facef4..0193d8d266 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousEqualsMethodNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SuspiciousEqualsMethodNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java
index 9d234b5800..6e341e0ebd 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousHashcodeMethodNameTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SuspiciousHashcodeMethodNameTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java
index 36a97b83ba..5c17a20755 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/SuspiciousOctalEscapeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class SuspiciousOctalEscapeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java
index 39f0f4fc47..b0a4edebce 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/TestClassWithoutTestCasesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class TestClassWithoutTestCasesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java
index e9fb6da5a1..6485314b6c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnconditionalIfStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnconditionalIfStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java
index e652838fc1..87621208a9 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryBooleanAssertionTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryBooleanAssertionTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java
index c2e0d37c4c..1a39ba29be 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryCaseChangeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryCaseChangeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java
index 4a08348e6b..54dfa6fc6c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnnecessaryConversionTemporaryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryConversionTemporaryTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java
index eaea9ff7e5..03383eca02 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UnusedNullCheckInEqualsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnusedNullCheckInEqualsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java
index 8c735a1623..deda76b27e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseCorrectExceptionLoggingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseCorrectExceptionLoggingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java
index cca09e5922..482ed8de75 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseEqualsToCompareStringsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseEqualsToCompareStringsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java
index 7c000a37b2..d592198d36 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseLocaleWithCaseConversionsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseLocaleWithCaseConversionsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java
index 7c968906b3..c310e27248 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UseProperClassLoaderTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseProperClassLoaderTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java
index cee396363f..eb8596e34e 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/errorprone/UselessOperationOnImmutableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UselessOperationOnImmutableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java
index 131e1de98e..3fb0c5506d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java
@@ -23,12 +23,12 @@ class DataflowPassTest extends BaseParserTest {
void testSimple() {
ASTCompilationUnit ast = java.parseResource(
- "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java",
- "20-preview"
+ "/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.java",
+ "21"
);
DataflowResult dataflow = DataflowPass.getDataflowResult(ast);
- assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(2));
+ assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(0));
}
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java
index 5552da8928..dd623cd341 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidSynchronizedAtMethodLevelTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidSynchronizedAtMethodLevelTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java
index 322be8e579..0c06cbd520 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidThreadGroupTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidThreadGroupTest extends PmdRuleTst {
// Used by AvoidThreadGroup test cases
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java
index 76a2a33966..5b34e87a17 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/AvoidUsingVolatileTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidUsingVolatileTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java
index a1ee5cbb12..dc8b383e6b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoNotUseThreadsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoNotUseThreadsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java
index 6c19a37681..53120d9528 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DontCallThreadRunTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DontCallThreadRunTest extends PmdRuleTst {
// Used by DontCallThreadRun test cases
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java
index 2dd1f220dc..903ad31b5f 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class DoubleCheckedLockingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java
index 5de60a32d9..b3ff3d7dba 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/NonThreadSafeSingletonTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NonThreadSafeSingletonTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java
index 6581d6ae33..0d3f1cbd57 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnsynchronizedStaticFormatterTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java
index 30b6abe091..2959aeaee6 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseConcurrentHashMapTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseConcurrentHashMapTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java
index d9c2cde3f2..5a93c3355b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/multithreading/UseNotifyAllInsteadOfNotifyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.multithreading;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseNotifyAllInsteadOfNotifyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java
index 6d774c1f03..37fddac850 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AddEmptyStringTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AddEmptyStringTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java
index b2def502e2..46ece8b851 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AppendCharacterWithCharTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AppendCharacterWithCharTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java
index 9dc04979f6..a0bca3e5f5 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidArrayLoopsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidArrayLoopsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java
index c065428ce7..dfbab65527 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidCalendarDateCreationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidCalendarDateCreationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java
index 1fb6565a3b..5df006ff24 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidFileStreamTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidFileStreamTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java
index 88ebdd345a..852c358a13 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/AvoidInstantiatingObjectsInLoopsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidInstantiatingObjectsInLoopsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java
index 08343bb36d..61670a7828 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/BigIntegerInstantiationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class BigIntegerInstantiationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java
index 9a15a27b88..d0579e70f7 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveAppendsShouldReuseTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConsecutiveAppendsShouldReuseTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java
index e93c5fc95f..7c8a188152 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/ConsecutiveLiteralAppendsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConsecutiveLiteralAppendsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java
index 223946a1be..480a307698 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InefficientEmptyStringCheckTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java
index ff0675aafa..54ffe496af 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientStringBufferingTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InefficientStringBufferingTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java
index 91d0e92985..e98a01ad11 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/InsufficientStringBufferDeclarationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InsufficientStringBufferDeclarationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java
index d0c1e11209..e5f1e92834 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/OptimizableToArrayCallTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class OptimizableToArrayCallTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java
index d8b57190f4..515a3ea422 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/RedundantFieldInitializerTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class RedundantFieldInitializerTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java
index 1f0b88431f..893a5a4332 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringInstantiationTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class StringInstantiationTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java
index 826f9d275f..54ceb4ad7d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/StringToStringTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class StringToStringTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java
index 7a34936d2d..3916959a96 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/TooFewBranchesForASwitchStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class TooFewBranchesForASwitchStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java
index 6a6f20f34b..57a489e815 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArrayListInsteadOfVectorTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseArrayListInsteadOfVectorTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java
index 6a8a9908f8..db1b6dc67b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseArraysAsListTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseArraysAsListTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java
index 6f10cf35c6..53cca44137 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIOStreamsWithApacheCommonsFileItemTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseIOStreamsWithApacheCommonsFileItemTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java
index 68837b160e..fdb10da98c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseIndexOfCharTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseIndexOfCharTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java
index 1cc6ed59a2..f7b764b30b 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferForStringAppendsTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseStringBufferForStringAppendsTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java
index af3368b481..a79cf05c1a 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UseStringBufferLengthTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseStringBufferLengthTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java
index b18c5b6b9b..4ddf1ee025 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/performance/UselessStringValueOfTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.performance;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UselessStringValueOfTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java
index 09046eec59..df2d6542ad 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/HardCodedCryptoKeyTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.security;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class HardCodedCryptoKeyTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java
index a502887680..019b3e8dd0 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/security/InsecureCryptoIvTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.rule.security;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InsecureCryptoIvTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java
index d59517e7c3..3f6f6dd9ac 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/xpath/internal/BaseXPathFunctionTest.java
@@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import net.sourceforge.pmd.lang.LanguageProcessor;
import net.sourceforge.pmd.lang.ast.FileAnalysisException;
-import net.sourceforge.pmd.lang.ast.test.TestUtilsKt;
import net.sourceforge.pmd.lang.java.BaseParserTest;
import net.sourceforge.pmd.lang.java.JavaLanguageModule;
import net.sourceforge.pmd.lang.rule.Rule;
@@ -23,6 +22,7 @@ import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException;
import net.sourceforge.pmd.lang.rule.xpath.PmdXPathException.Phase;
import net.sourceforge.pmd.lang.rule.xpath.XPathRule;
import net.sourceforge.pmd.lang.rule.xpath.XPathVersion;
+import net.sourceforge.pmd.lang.test.ast.TestUtilsKt;
import net.sourceforge.pmd.reporting.Report;
/**
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java
index 597b2526f8..d85783803c 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/types/TypesTreeDumpTest.java
@@ -10,9 +10,9 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.lang.ast.Node;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
-import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest;
-import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
+import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter;
import net.sourceforge.pmd.lang.java.JavaParsingHelper;
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr;
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt
index ef1de16c16..3ee795c82f 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_3
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 9443e7e55a..d209ba43da 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
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_ANONYMOUS
class ASTAnonymousClassTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt
index 213d687ab6..a667e208ad 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* Nodes that previously corresponded to ASTAllocationExpression.
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt
index ba92d24450..b8d6e8502d 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt
index 59c17e7482..26f70800ba 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt
index 53c5b73398..8706831bfd 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE
import net.sourceforge.pmd.lang.java.ast.AssignmentOp.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt
index ed3cb48cea..bf7f77c20a 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt
@@ -4,10 +4,9 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
-import net.sourceforge.pmd.lang.java.ast.ExpressionParsingCtx
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
class ASTCastExpressionTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt
index dbfe402bea..4039461e8e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.string.shouldContain
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt
index bd0919054d..9ca8a75c99 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
class ASTClassDeclarationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt
index 46f1adbaf9..6a1276e645 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt
index fdcb0df4bc..5077fdfa89 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ
class ASTConstructorCallTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt
index 8b50566636..aa0d9bc631 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
class ASTConstructorDeclarationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt
index a6dc2550b8..23328aa275 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.should
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JModifier.*
class ASTEnumConstantTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt
index a70887f661..2f318c9b2d 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
class ASTExplicitConstructorInvocationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt
index b259b9c1bc..60571e0731 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt
@@ -4,15 +4,14 @@
package net.sourceforge.pmd.lang.java.ast
-import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* @author Clément Fournier
*/
class ASTFieldAccessTest : ParserTestSpec({
- parserTest("Field access exprs") {
+ parserTest("Field access expressions") {
inContext(ExpressionParsingCtx) {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt
index 47306a36da..247a1da412 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt
@@ -6,8 +6,8 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.textOfReportLocation
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.textOfReportLocation
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
class ASTFieldDeclarationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt
index 104328a259..3c3a4682e3 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind
class ASTInstanceOfExpressionTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt
index eb355dda7b..9be4a6400e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt
index 233a6a07aa..92d43cdffd 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt
@@ -5,8 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
@@ -14,6 +13,9 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since
import net.sourceforge.pmd.lang.java.ast.UnaryOp.UNARY_MINUS
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
+import net.sourceforge.pmd.lang.test.ast.NodeSpec
+import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldHaveText
/**
* @author Clément Fournier
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt
index eeaafcd524..064f8fd8a2 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
class ASTLocalVariableDeclarationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt
index e22d343589..a08cbf76df 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* @author Clément Fournier
@@ -13,7 +13,7 @@ import net.sourceforge.pmd.lang.ast.test.shouldBe
class ASTMethodCallTest : ParserTestSpec({
- parserTest("Method call exprs") {
+ parserTest("Method call expressions") {
inContext(ExpressionParsingCtx) {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt
index ff47a82431..3702e4b924 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNot
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.textOfReportLocation
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.textOfReportLocation
import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PRIVATE
import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_PUBLIC
import net.sourceforge.pmd.lang.java.ast.JModifier.*
@@ -138,7 +138,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({
}
}
- // default abstract is an invalid combination of modifiers so we won't encounter it in real analysis
+ // default abstract is an invalid combination of modifiers, so we won't encounter it in real analysis
}
parserTest("Throws list") {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt
index 55ab0f5d51..97791223ea 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt
index ec40f586ec..fdce63d865 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt
@@ -8,8 +8,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper
import io.kotest.matchers.collections.shouldBeEmpty
import io.kotest.matchers.shouldBe
import net.sourceforge.pmd.lang.ast.Node
-import net.sourceforge.pmd.lang.ast.test.NodeSpec
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.NodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt
index 80549663cd..b9ba5114a4 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt
@@ -5,7 +5,6 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import io.kotest.matchers.shouldNot
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J16
import java.io.IOException
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt
index 986d7623bf..a0d0284216 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
class ASTStatementsTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt
index bd2bd9096f..112d98edc6 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* @author Clément Fournier
@@ -31,7 +31,7 @@ class ASTSuperExpressionTest : ParserTestSpec({
// a method call, field access, or method reference
"super" shouldNot parse()
- // type arguments and annots are disallowed on the qualifier
+ // type arguments and annotations are disallowed on the qualifier
"T.B.super::foo" shouldNot parse()
"T.B.super.foo()" shouldNot parse()
"T.@F B.super.foo()" shouldNot parse()
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt
index b1be8e2041..0c80b00810 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt
@@ -5,8 +5,8 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.BinaryOp.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Earliest
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt
index dc49ff18d4..c0654423da 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* @author Clément Fournier
@@ -47,7 +47,7 @@ class ASTThisExpressionTest : ParserTestSpec({
parserTest("Neg cases") {
inContext(ExpressionParsingCtx) {
- // type arguments and annots are disallowed on the qualifier
+ // type arguments and annotations are disallowed on the qualifier
"T.B.this" shouldNot parse()
"T.@F B.this" shouldNot parse()
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt
index 091a931fe8..ad2c6a3682 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_7
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt
index bee2963f29..71092f20cf 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
* @author Clément Fournier
@@ -59,9 +59,9 @@ class ASTTypeTest : ParserTestSpec({
// So @B binds to "java"
// If the annotation is not applicable to TYPE_USE then it doesn't compile
- // this happens in type context, eg in a cast, or in an extends list
+ // this happens in type context, e.g. in a cast, or in an extends list
- // TYPE_USE annotations are prohibited eg before a declaration
+ // TYPE_USE annotations are prohibited e.g. before a declaration
inContext(TypeParsingCtx) {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt
index fd2bb913fc..d13cb2483c 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt
@@ -84,7 +84,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({
parserTest("Unary expression ambiguity corner cases") {
- // the following cases test ambiguity between cast of unary, and eg parenthesized additive expr
+ // the following cases test ambiguity between cast of unary, and e.g. parenthesized additive expr
// see https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-UnaryExpressionNotPlusMinus
// comments about ambiguity are below grammar
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt
index 7a30b86ed3..2178115173 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_5
import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt
index c0457ac822..9c2e147443 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt
index 8a0e225520..9d621fadfc 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt
@@ -4,11 +4,9 @@
package net.sourceforge.pmd.lang.java.ast
-import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest
+import net.sourceforge.pmd.lang.test.ast.shouldBe
class Java11Test : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt
index 1063b8b919..03e2b01cf8 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
class Java15KotlinTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt
index b11f001382..7609f2a3cc 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
import net.sourceforge.pmd.lang.ast.TextAvailableNode
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
// Use a string for comparison because CharSequence are not necessarily
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt
index b84c3ba443..88f6225067 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaUnicodeEscapesTest.kt
@@ -8,8 +8,8 @@ import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.string.shouldContain
import net.sourceforge.pmd.lang.ast.impl.javacc.MalformedSourceException
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.document.TextDocument
import net.sourceforge.pmd.lang.java.JavaParsingHelper
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt
index 791df7c2a3..c1c97245a6 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/KotlinTestingDsl.kt
@@ -13,10 +13,9 @@ import io.kotest.matchers.Matcher
import io.kotest.matchers.MatcherResult
import io.kotest.matchers.collections.shouldContainAll
import net.sourceforge.pmd.lang.ast.*
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.java.JavaLanguageModule
import net.sourceforge.pmd.lang.java.JavaParsingHelper
import net.sourceforge.pmd.lang.java.JavaParsingHelper.*
+import net.sourceforge.pmd.lang.test.ast.*
import java.beans.PropertyDescriptor
import java.io.PrintStream
import java.util.*
@@ -34,14 +33,13 @@ enum class JavaVersion : Comparable {
J17,
J18,
J19,
- J20, J20__PREVIEW,
- J21, J21__PREVIEW;
+ J20,
+ J21, J21__PREVIEW,
+ J22, J22__PREVIEW;
/** Name suitable for use with e.g. [JavaParsingHelper.parse] */
val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase()
- val pmdVersion get() = JavaLanguageModule.getInstance().getVersion(pmdName)
-
val parser: JavaParsingHelper = DEFAULT.withDefaultVersion(pmdName)
operator fun not(): List = values().toList() - this
@@ -64,9 +62,9 @@ enum class JavaVersion : Comparable {
fun since(v: JavaVersion) = v.rangeTo(Latest)
fun except(v1: JavaVersion, vararg versions: JavaVersion) =
- values().toList() - v1 - versions
+ values().toList() - v1 - versions.toSet()
- fun except(versions: List) = values().toList() - versions
+ fun except(versions: List) = values().toList() - versions.toSet()
}
}
@@ -151,8 +149,8 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean
* Can be used inside of a [ParserTestSpec] with [ParserTestSpec.parserTest].
*
* Parsing contexts allow to parse a string containing only the node you're interested
- * in instead of writing up a full class that the parser can handle. See [parseExpression],
- * [parseStatement].
+ * in instead of writing up a full class that the parser can handle. See [ExpressionParsingCtx],
+ * [StatementParsingCtx].
*
* These are implicitly used by [matchExpr] and [matchStmt], which specify a matcher directly
* on the strings, using their type parameter and the info in this test context to parse, find
@@ -169,7 +167,7 @@ inline fun JavaNode?.shouldMatchNode(ignoreChildren: Boolean
* Import statements in the parsing contexts can be configured by adding types to [importedTypes],
* or strings to [otherImports].
*
- * Technically the utilities provided by this class may be used outside of [io.kotest.specs.FunSpec]s,
+ * Technically the utilities provided by this class may be used outside of [io.kotest.core.spec.Spec]s,
* e.g. in regular JUnit tests, but I think we should strive to uniformize our testing style,
* especially since KotlinTest defines so many.
*
@@ -224,7 +222,7 @@ open class ParserTestCtx(testScope: TestScope,
/**
* Places all node parsing contexts inside the declaration of the given class
* of the given class.
- * It's like you were writing eg expressions inside the class, with the method
+ * It's like you were writing e.g. expressions inside the class, with the method
* declarations around it and all.
*
* LIMITATIONS:
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt
index b4fcb2c962..3b38656fa6 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.*
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt
index 2bf63f7669..cecc164d17 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/NodeParsingCtx.kt
@@ -5,6 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import net.sourceforge.pmd.lang.ast.Node
+import net.sourceforge.pmd.lang.ast.ParseException
import net.sourceforge.pmd.lang.java.JavaParsingHelper
/**
@@ -139,7 +140,7 @@ $construct
}
override fun retrieveNode(acu: ASTCompilationUnit): ASTBodyDeclaration =
- acu.typeDeclarations.firstOrThrow().getDeclarations().firstOrThrow()
+ acu.typeDeclarations.firstOrThrow().declarations.firstOrThrow()
}
object TopLevelTypeDeclarationParsingCtx : NodeParsingCtx("top-level declaration") {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt
index d5a59df21a..8ada650628 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
/**
@@ -73,7 +73,7 @@ class ParenthesesTest : ParserTestSpec({
it::getParenthesisDepth shouldBe 2
it::isParenthesized shouldBe true
- it.tokenList().map { it.image } shouldBe listOf("(", "(", "a", ")", ")")
+ it.tokenList().map { token -> token.image } shouldBe listOf("(", "(", "a", ")", ")")
}
}
}
@@ -95,7 +95,7 @@ class ParenthesesTest : ParserTestSpec({
it::getParenthesisDepth shouldBe 1
it::isParenthesized shouldBe true
- it.tokenList().map { it.image } shouldBe listOf("(", "a", ")")
+ it.tokenList().map { token -> token.image } shouldBe listOf("(", "a", ")")
}
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt
index c12f489053..7fd12125b3 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt
@@ -17,10 +17,10 @@ import io.kotest.core.test.TestType
import io.kotest.matchers.Matcher
import net.sourceforge.pmd.lang.ast.Node
import net.sourceforge.pmd.lang.ast.ParseException
-import net.sourceforge.pmd.lang.ast.test.Assertions
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.Assertions
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.types.JTypeMirror
import net.sourceforge.pmd.lang.java.types.TypeDslMixin
import net.sourceforge.pmd.lang.java.types.TypeDslOf
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt
index 1759e7c91b..bb3fed6787 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TestExtensions.kt
@@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.types.shouldBeInstanceOf
import net.sourceforge.pmd.lang.ast.Node
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken
-import net.sourceforge.pmd.lang.ast.test.NodeSpec
-import net.sourceforge.pmd.lang.ast.test.ValuedNodeSpec
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.NodeSpec
+import net.sourceforge.pmd.lang.test.ast.ValuedNodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.internal.PrettyPrintingUtil
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
@@ -256,8 +256,8 @@ fun TreeNodeWrapper.returnStatement(contents: ValuedNodeSpec.forLoop(body: ValuedNodeSpec = { null }) =
child {
- val body = body()
- if (body != null) it::getBody shouldBe body
+ val expectedBody = body()
+ if (expectedBody != null) it::getBody shouldBe expectedBody
else unspecifiedChildren(it.numChildren)
}
@@ -280,22 +280,22 @@ fun TreeNodeWrapper.statementExprList(body: NodeSpec.foreachLoop(body: ValuedNodeSpec = { null }) =
child {
- val body = body()
- if (body != null) it::getBody shouldBe body
+ val expectedBody = body()
+ if (expectedBody != null) it::getBody shouldBe expectedBody
else unspecifiedChildren(it.numChildren)
}
fun TreeNodeWrapper.doLoop(body: ValuedNodeSpec = { null }) =
child {
- val body = body()
- if (body != null) it::getBody shouldBe body
+ val expectedBody = body()
+ if (expectedBody != null) it::getBody shouldBe expectedBody
else unspecifiedChildren(it.numChildren)
}
fun TreeNodeWrapper.whileLoop(body: ValuedNodeSpec = { null }) =
child {
- val body = body()
- if (body != null) it::getBody shouldBe body
+ val expectedBody = body()
+ if (expectedBody != null) it::getBody shouldBe expectedBody
else unspecifiedChildren(it.numChildren)
}
@@ -398,7 +398,7 @@ fun TreeNodeWrapper.unionType(contents: NodeSpec = EmptyA
contents()
}
-fun TreeNodeWrapper.voidType() = child() {}
+fun TreeNodeWrapper.voidType() = child {}
fun TreeNodeWrapper.typeExpr(contents: ValuedNodeSpec) =
@@ -425,7 +425,7 @@ fun TreeNodeWrapper.arrayType(contents: NodeSpec = EmptyA
fun TreeNodeWrapper.primitiveType(type: PrimitiveTypeKind, assertions: NodeSpec = EmptyAssertions) =
child {
it::getKind shouldBe type
- PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString();
+ PrettyPrintingUtil.prettyPrintType(it) shouldBe type.toString()
assertions()
}
@@ -586,8 +586,8 @@ fun TreeNodeWrapper.switchStmt(assertions: NodeSpec
fun TreeNodeWrapper.switchArrow(rhs: ValuedNodeSpec = { null }) =
child {
- val rhs = rhs()
- if (rhs != null) it::getRightHandSide shouldBe rhs
+ val expectedRhs = rhs()
+ if (expectedRhs != null) it::getRightHandSide shouldBe expectedRhs
else unspecifiedChildren(2) // label + rhs
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt
index c035c51635..40666304eb 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TokenUtilsTest.kt
@@ -9,8 +9,8 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.core.test.TestScope
import io.kotest.matchers.shouldBe
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken
-import net.sourceforge.pmd.lang.ast.test.Assertions
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.Assertions
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
/**
* @author Clément Fournier
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt
index 7cf336cf72..fa37adf86c 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt
@@ -8,11 +8,11 @@ import io.kotest.matchers.collections.shouldBeEmpty
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeSameInstanceAs
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.ast.test.shouldBe
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.*
import net.sourceforge.pmd.lang.java.types.JClassType
+import net.sourceforge.pmd.lang.test.ast.*
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import kotlin.test.assertEquals
import kotlin.test.assertNull
@@ -246,18 +246,18 @@ class TypeDisambiguationTest : ParserTestSpec({
val outerUnresolved = m0.qualifier!!
val outerT = outerUnresolved.typeMirror.shouldBeA {
- it.symbol.shouldBeA {
- it::isUnresolved shouldBe true
- it::getSimpleName shouldBe "OuterUnresolved"
+ it.symbol.shouldBeA { classSymbol ->
+ classSymbol::isUnresolved shouldBe true
+ classSymbol::getSimpleName shouldBe "OuterUnresolved"
}
}
val innerT = m0.typeMirror.shouldBeA {
it::getEnclosingType shouldBe outerT
- it.symbol.shouldBeA {
- it::isUnresolved shouldBe true
- it::getSimpleName shouldBe "InnerUnresolved"
- it.enclosingClass.shouldBeSameInstanceAs(outerT.symbol)
+ it.symbol.shouldBeA { classSymbol ->
+ classSymbol::isUnresolved shouldBe true
+ classSymbol::getSimpleName shouldBe "InnerUnresolved"
+ classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol)
}
}
@@ -314,7 +314,7 @@ class TypeDisambiguationTest : ParserTestSpec({
// before all classes of the CU have been visited
enableProcessing()
- val acu = parser.parse("""
+ @Suppress("UNUSED_VARIABLE") val acu = parser.parse("""
package p;
import static p.Assert2.*;
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt
index bf332c059f..390f485dd3 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt
@@ -8,8 +8,8 @@ import io.kotest.matchers.collections.shouldBeSingleton
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.WRITE
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol
import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol
@@ -65,13 +65,13 @@ class UsageResolutionTest : ProcessorTestSpec({
p::isRecordComponent shouldBe true
p.localUsages.shouldHaveSize(2)
p.localUsages[0].shouldBeA {
- it.referencedSym!!.shouldBeA {
- it.tryGetNode() shouldBe p
+ it.referencedSym!!.shouldBeA { symbol ->
+ symbol.tryGetNode() shouldBe p
}
}
p.localUsages[1].shouldBeA {
- it.referencedSym!!.shouldBeA {
- it.tryGetNode() shouldBe p
+ it.referencedSym!!.shouldBeA { symbol ->
+ symbol.tryGetNode() shouldBe p
}
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt
index d890ddd97d..56fd0976fd 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt
@@ -5,13 +5,12 @@
package net.sourceforge.pmd.lang.java.ast
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.JavaParsingHelper
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol
-import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors
import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.*
class VarDisambiguationTest : ParserTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt
index 2ed8e06068..650033a3f4 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal
import io.kotest.matchers.types.shouldBeSameInstanceAs
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.InternalApiBridge
import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt
index cb8c48b9c8..e6a19c4981 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt
@@ -4,16 +4,16 @@
package net.sourceforge.pmd.lang.java.symbols.internal
+import io.kotest.matchers.collections.haveSize
import io.kotest.matchers.collections.shouldBeEmpty
import io.kotest.matchers.collections.shouldHaveSize
-import io.kotest.matchers.collections.haveSize
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.ast.test.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.*
import net.sourceforge.pmd.lang.java.types.Substitution
+import net.sourceforge.pmd.lang.test.ast.*
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import java.lang.reflect.Modifier
/**
@@ -386,7 +386,7 @@ class AstSymbolTests : ParserTestSpec({
val (canonCtor1, canonCtor2) = acu.descendants(ASTRecordComponentList::class.java).toList { it.symbol }
val (auxCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol }
val (xAccessor) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol }
- val (xComp, yComp, x2Comp, y2Comp, x2Formal) = acu.descendants(ASTVariableId::class.java).toList { it.symbol }
+ val (xComp, yComp, _, y2Comp, _) = acu.descendants(ASTVariableId::class.java).toList { it.symbol }
doTest("should reflect their modifiers") {
@@ -550,7 +550,7 @@ class AstSymbolTests : ParserTestSpec({
}
// all others are Runnable
- (allAnons - anonsWithSuperClass).forEach {
+ (allAnons - anonsWithSuperClass.toSet()).forEach {
it::getSuperclass shouldBe it.typeSystem.OBJECT.symbol
it::getSuperInterfaces shouldBe listOf(it.typeSystem.getClassSymbol(Runnable::class.java))
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt
index fae15094cd..81ea2e6c58 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/PrimitiveSymbolTests.kt
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.collections.shouldBeEmpty
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.types.testTypeSystem
@@ -17,7 +17,7 @@ import net.sourceforge.pmd.lang.java.types.testTypeSystem
*/
class PrimitiveSymbolTests : WordSpec({
- fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol!! }
+ fun primitives(): List = testTypeSystem.allPrimitives.map { it.symbol }
"A primitive symbol" should {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt
index 5051b1396e..198e9eff07 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedClassSymbolTests.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.shouldBe
import io.kotest.property.checkAll
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.testTypeSystem
/**
@@ -40,7 +40,7 @@ class ReflectedClassSymbolTests : IntelliMarker, WordSpec({
"reflect its superinterfaces correctly" {
TestClassesGen.forAllEqual {
- classSym(it)!!.superInterfaces to it.interfaces.toList().map { classSym(it) }
+ classSym(it)!!.superInterfaces to it.interfaces.toList().map { clazz -> classSym(clazz) }
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt
index bf09835375..6c94586930 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/ReflectedFieldSymbolTest.kt
@@ -6,12 +6,13 @@ package net.sourceforge.pmd.lang.java.symbols.internal
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.WordSpec
+import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.kotest.property.arbitrary.filterNot
import javasymbols.testdata.impls.IdenticalToSomeFields
import javasymbols.testdata.impls.SomeFields
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
/**
* @author Clément Fournier
@@ -39,8 +40,8 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({
"reflect its modifiers properly" {
TestClassesGen.filterNot { it.isArray }.forAllEqual {
Pair(
- classSym(it)!!.declaredFields.map { it.simpleName to it.modifiers },
- it.declaredFields.map { it.name to it.modifiers }
+ classSym(it)!!.declaredFields.map { fieldSymbol -> fieldSymbol.simpleName to fieldSymbol.modifiers },
+ it.declaredFields.map { field -> field.name to field.modifiers }
)
}
}
@@ -56,9 +57,14 @@ class ReflectedFieldSymbolTest : IntelliMarker, WordSpec({
}
"be unmodifiable" {
- shouldThrow {
- classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.add(null)
- }
+ val declaredAnnotations = classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations
+ declaredAnnotations.size shouldBeExactly 1
+ val annot = declaredAnnotations.first()
+ declaredAnnotations.plus(annot)
+ declaredAnnotations.size shouldBeExactly 1
+
+ // still unmodified
+ classSym(SomeFields::class.java)!!.getDeclaredField("foo")!!.declaredAnnotations.size shouldBeExactly 1
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt
index 86d0561cee..454c33393f 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/UnresolvedClassTest.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.symbols.internal
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.collections.haveSize
import io.kotest.matchers.should
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.testTypeSystem
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt
index d83b1cafbc..549db7c9e8 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/Utils.kt
@@ -8,7 +8,6 @@ import io.kotest.assertions.withClue
import io.kotest.matchers.collections.haveSize
import io.kotest.matchers.should
import io.kotest.property.*
-import io.kotest.property.arbitrary.arbitrary
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.SymbolResolver
import net.sourceforge.pmd.lang.java.types.testTypeSystem
@@ -80,7 +79,7 @@ object TestClassesGen : Arb>() {
return
}
val files = directory.listFiles()
- for (file in files) {
+ for (file in files!!) {
if (file.isDirectory) {
assert(!file.name.contains("."))
findClasses(file, packageName + "." + file.name)
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt
index a89096feb6..4ffcc088cd 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/AsmLoaderTest.kt
@@ -20,8 +20,8 @@ import javasymbols.testdata.deep.AClassWithLocals
import javasymbols.testdata.deep.`Another$ClassWith$Dollar`
import javasymbols.testdata.deep.OuterWithoutDollar
import javasymbols.testdata.impls.GenericClass
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.types.testTypeSystem
import org.objectweb.asm.Opcodes
import kotlin.test.assertSame
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt
index 85f988420c..8ef67a8682 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/BrokenClasspathTest.kt
@@ -9,7 +9,7 @@ import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.types.JClassType
import net.sourceforge.pmd.lang.java.types.TypeOps
@@ -59,7 +59,7 @@ class BrokenClasspathTest : FunSpec({
// since we're loading things lazily this type hasn't tried to populate its superinterfaces
val superItfType = ts.declaration(unresolvedItfSym) as JClassType
val subclassType = ts.declaration(subclassSym) as JClassType
- val (tvarC, tvarD) = subclassType.formalTypeParams
+ val (_, tvarD) = subclassType.formalTypeParams
// and now since the super interface *type* is parameterized, we'll try to create SuperItf
// Except SuperItf is unresolved.
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt
index 77d0df6cf4..ad89d9715b 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/NamesTest.kt
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
class NamesTest : IntelliMarker, FunSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt
index 4d16fdc868..723d288eaa 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/asm/SigParserTest.kt
@@ -7,14 +7,12 @@ package net.sourceforge.pmd.lang.java.symbols.internal.asm
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
-import io.kotest.matchers.Matcher
import io.kotest.matchers.collections.shouldHaveSize
-import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import javasymbols.testdata.impls.SomeInnerClasses
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol
import net.sourceforge.pmd.lang.java.symbols.internal.asm.GenericSigBase.LazyMethodType
import net.sourceforge.pmd.lang.java.symbols.internal.asm.TypeParamsParser.BaseTypeParamsBuilder
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt
index e580ec1ceb..b01f0de42a 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt
@@ -7,8 +7,6 @@
package net.sourceforge.pmd.lang.java.symbols.table.internal
import io.kotest.matchers.collections.*
-import io.kotest.matchers.maps.shouldBeEmpty
-import io.kotest.matchers.maps.shouldContain
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
@@ -16,8 +14,8 @@ import io.kotest.matchers.shouldNotBe
import javasymbols.testdata.StaticNameCollision
import javasymbols.testdata.StaticsSuper
import javasymbols.testdata.deep.OuterWithoutDollar
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol
@@ -252,8 +250,8 @@ class HeaderScopesTest : ProcessorTestSpec({
it.apply {
scopeTag shouldBe SINGLE_IMPORT
results should haveSize(2)
- results.forEach {
- it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision"
+ results.forEach { methodSig ->
+ methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.StaticNameCollision"
}
}
@@ -261,8 +259,8 @@ class HeaderScopesTest : ProcessorTestSpec({
it.apply {
scopeTag shouldBe IMPORT_ON_DEMAND
results should haveSize(2)
- results.forEach {
- it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics"
+ results.forEach { methodSig ->
+ methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics"
}
}
}
@@ -276,8 +274,8 @@ class HeaderScopesTest : ProcessorTestSpec({
it.apply {
scopeTag shouldBe IMPORT_ON_DEMAND
results should haveSize(1)
- results.forEach {
- it.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics"
+ results.forEach { methodSig ->
+ methodSig.symbol.enclosingClass.canonicalName shouldBe "javasymbols.testdata.Statics"
}
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt
index eb874dca5e..1ef96da29e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.symbols.table.internal
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.JClassType
import net.sourceforge.pmd.lang.java.types.shouldHaveType
@@ -112,7 +112,7 @@ class LocalTypeScopesTest : ParserTestSpec({
}
""")
- val (foo, inner, other) =
+ val (foo, inner, _) =
acu.descendants(ASTClassDeclaration::class.java).toList()
val (insideFoo, insideInner, insideOther) =
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 47f9947c13..5541e02365 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
@@ -9,10 +9,10 @@ import io.kotest.matchers.collections.shouldBeSingleton
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.component6
-import net.sourceforge.pmd.lang.ast.test.component7
-import net.sourceforge.pmd.lang.ast.test.component8
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.component6
+import net.sourceforge.pmd.lang.test.ast.component7
+import net.sourceforge.pmd.lang.test.ast.component8
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.ShadowChain
import net.sourceforge.pmd.lang.java.types.*
@@ -261,26 +261,26 @@ class MemberInheritanceTest : ParserTestSpec({
}
""")
- val (t_Scratch, t_Inner) =
+ val (typeScratch, typeInner) =
acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror }
val insideFoo =
acu.descendants(ASTClassBody::class.java)
.crossFindBoundaries().get(2)!!
- val `t_Scratch{String}Inner` = with (acu.typeDsl) {
- t_Scratch[gen.t_String].selectInner(t_Inner.symbol, emptyList())
+ val `typeScratch{String}Inner` = with (acu.typeDsl) {
+ typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList())
}
insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton {
- it.shouldBe(`t_Scratch{String}Inner`)
+ it.shouldBe(`typeScratch{String}Inner`)
}
val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!!
typeNode.shouldMatchN {
classType("Inner") {
- it shouldHaveType `t_Scratch{String}Inner`
+ it shouldHaveType `typeScratch{String}Inner`
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt
index a87634d1a4..fa253394da 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt
@@ -5,8 +5,8 @@
package net.sourceforge.pmd.lang.java.symbols.table.internal
import io.kotest.assertions.withClue
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.*
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt
index a209022c13..0546cc0878 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt
@@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeSameInstanceAs
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.JClassType
import net.sourceforge.pmd.lang.java.types.JTypeVar
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt
index 24875a282d..adf653406d 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/Utils.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.symbols.table.internal
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.ASTVariableId
import net.sourceforge.pmd.lang.java.ast.JavaNode
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt
index 2435e576d5..33869571c3 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt
@@ -4,17 +4,17 @@
package net.sourceforge.pmd.lang.java.symbols.table.internal
-import io.kotest.matchers.should
-import io.kotest.matchers.shouldBe
import io.kotest.matchers.collections.beEmpty
import io.kotest.matchers.collections.shouldBeEmpty
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import io.kotest.matchers.should
+import io.kotest.matchers.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol
import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol
import net.sourceforge.pmd.lang.java.symbols.JLocalVariableSymbol
import net.sourceforge.pmd.lang.java.types.shouldHaveType
+import net.sourceforge.pmd.lang.test.ast.*
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import java.lang.reflect.Modifier
@Suppress("UNUSED_VARIABLE")
@@ -426,7 +426,7 @@ class VarScopingTest : ProcessorTestSpec({
""".trimIndent())
- val (_, t_SomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror }
+ val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror }
val (enumA, enumB) =
acu.descendants(ASTEnumDeclaration::class.java)
@@ -443,17 +443,17 @@ class VarScopingTest : ProcessorTestSpec({
qualifiedA.referencedSym shouldBe enumA.symbol
qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA
- qualifiedA shouldHaveType t_SomeEnum
+ qualifiedA shouldHaveType typeSomeEnum
caseA.referencedSym shouldBe enumA.symbol
caseA.referencedSym!!.tryGetNode() shouldBe enumA
- caseA shouldHaveType t_SomeEnum
+ caseA shouldHaveType typeSomeEnum
caseB.referencedSym shouldBe enumB.symbol
caseB.referencedSym!!.tryGetNode() shouldBe enumB
- caseB shouldHaveType t_SomeEnum
+ caseB shouldHaveType typeSomeEnum
- e shouldHaveType t_SomeEnum
+ e shouldHaveType typeSomeEnum
// symbol tables don't carry that info, this is documented on JSymbolTable#variables()
caseB.symbolTable.variables().resolve("A").shouldBeEmpty()
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt
index 34d72f2690..5b7fb22063 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ArraySymbolTests.kt
@@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types
import io.kotest.core.spec.style.WordSpec
import io.kotest.matchers.collections.shouldHaveSize
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.JavaNode
import net.sourceforge.pmd.lang.java.symbols.JAccessibleElementSymbol.PRIMITIVE_PACKAGE
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol
@@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.symbols.internal.getDeclaredMethods
*/
class ArraySymbolTests : WordSpec({
- val INT_SYM = testTypeSystem.getClassSymbol(java.lang.Integer.TYPE)
+ val INT_SYM = testTypeSystem.getClassSymbol(Integer.TYPE)
val STRING_SYM = testTypeSystem.getClassSymbol(java.lang.String::class.java)
fun makeArraySym(comp: JTypeDeclSymbol?) = ArraySymbolImpl(testTypeSystem, comp)
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt
index f061b0050a..2d0739dda1 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/BoxingTest.kt
@@ -10,7 +10,6 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.types.shouldBeInstanceOf
import io.kotest.matchers.types.shouldBeSameInstanceAs
-import io.kotest.property.forAll
import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt
index 951f12c671..03125a0a58 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt
@@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.types
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
import net.sourceforge.pmd.lang.java.types.TypeConversion.*
@@ -58,7 +57,7 @@ class CaptureTest : FunSpec({
}
test("Capture of malformed types") {
- val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol
+ val sym = ts.createUnresolvedAsmSymbol("does.not.Exist")
val matcher = captureMatcher(`?` extends t_String).also {
capture(sym[t_String, `?` extends t_String]) shouldBe sym[t_String, it]
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt
index 3033056626..0ee4f05858 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ClassTypeImplTest.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt
index 95ade83763..0e9f8dff3f 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/GlbTest.kt
@@ -10,7 +10,7 @@ import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.nulls.shouldBeNull
import io.kotest.matchers.shouldBe
import io.kotest.property.checkAll
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt
index 2ac7f7d79a..3b9b28c748 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt
@@ -7,8 +7,8 @@
package net.sourceforge.pmd.lang.java.types
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
class InnerTypesTest : ProcessorTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt
index d10837f433..2270f70e93 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JPrimitiveTypeTest.kt
@@ -8,7 +8,7 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.collections.shouldBeEmpty
import io.kotest.matchers.collections.shouldContain
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt
index 0379c4ed00..092e03c6bb 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SpecialTypesTest.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
/**
*/
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt
index 1fdb1affa0..03cfcddb4a 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubtypingTest.kt
@@ -13,9 +13,8 @@ import io.kotest.property.Exhaustive
import io.kotest.property.checkAll
import io.kotest.property.exhaustive.ints
import io.kotest.property.forAll
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.ParserTestCtx
-import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.internal.UnresolvedClassStore
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
import net.sourceforge.pmd.lang.java.types.TypeConversion.*
@@ -157,10 +156,10 @@ class SubtypingTest : FunSpec({
test("Test raw type is convertible to wildcard parameterized type without unchecked conversion") {
val `Class{String}` = Class::class[ts.STRING]
- val `Class{?}` = Class::class[`?`]
+ val `Class{Wildcard}` = Class::class[`?`]
val Class = Class::class.raw
- val `Comparable{?}` = java.lang.Comparable::class[`?`]
+ val `Comparable{Wildcard}` = java.lang.Comparable::class[`?`]
/*
Class raw = String.class;
@@ -179,15 +178,15 @@ class SubtypingTest : FunSpec({
`Class{String}` shouldBeSubtypeOf Class
- `Class{?}` shouldBeSubtypeOf Class
+ `Class{Wildcard}` shouldBeSubtypeOf Class
- `Class{String}` shouldBeSubtypeOf `Class{?}`
- `Class{?}` shouldNotBeSubtypeOf `Class{String}`
+ `Class{String}` shouldBeSubtypeOf `Class{Wildcard}`
+ `Class{Wildcard}` shouldNotBeSubtypeOf `Class{String}`
- assertSubtype(Class, `Class{?}`) { this == UNCHECKED_NO_WARNING }
+ assertSubtype(Class, `Class{Wildcard}`) { this == UNCHECKED_NO_WARNING }
Class shouldBeUncheckedSubtypeOf `Class{String}`
- ts.STRING shouldBeSubtypeOf `Comparable{?}`
+ ts.STRING shouldBeSubtypeOf `Comparable{Wildcard}`
}
test("Test wildcard subtyping") {
@@ -319,7 +318,7 @@ class SubtypingTest : FunSpec({
}
test("Test non well-formed types") {
- val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol
+ val sym = ts.createUnresolvedAsmSymbol("does.not.Exist")
sym[t_String, t_String] shouldBeUnrelatedTo sym[t_String]
sym[t_String] shouldBeSubtypeOf sym[t_String]
sym[t_String] shouldBeSubtypeOf sym[`?` extends t_String] // containment
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt
index 90482a9828..af662f19e1 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt
@@ -8,18 +8,18 @@
package net.sourceforge.pmd.lang.java.types
import io.kotest.assertions.*
-import io.kotest.assertions.print.Printed
import io.kotest.assertions.print.print
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
import net.sourceforge.pmd.lang.java.JavaParsingHelper
-import net.sourceforge.pmd.lang.java.ast.*
+import net.sourceforge.pmd.lang.java.ast.InvocationNode
+import net.sourceforge.pmd.lang.java.ast.TypeNode
import net.sourceforge.pmd.lang.java.symbols.internal.asm.AsmSymbolResolver
import net.sourceforge.pmd.lang.java.types.TypeOps.*
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import org.hamcrest.Description
+import java.util.stream.Collectors
import kotlin.String
-import kotlin.streams.toList
import kotlin.test.assertTrue
/*
@@ -45,7 +45,7 @@ val TypeSystem.STRING get() = declaration(getClassSymbol(String::class.java)) as
typealias TypePair = Pair
-fun JTypeMirror.getMethodsByName(name: String) = streamMethods { it.simpleName == name }.toList()
+fun JTypeMirror.getMethodsByName(name: String): List = streamMethods { it.simpleName == name }.collect(Collectors.toList())
fun JTypeMirror.shouldBeUnresolvedClass(canonicalName: String) =
this.shouldBeA {
@@ -225,6 +225,7 @@ val JTypeMirror.isExlusiveIntersectionBound
/**
* Was added in java 12.
*/
+@Suppress("UNCHECKED_CAST")
val Class.arrayType: Class>
get() {
val arr = java.lang.reflect.Array.newInstance(this, 0)
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt
index f274fd9122..e0afd0284a 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeCreationDsl.kt
@@ -7,7 +7,6 @@
package net.sourceforge.pmd.lang.java.types
import net.sourceforge.pmd.lang.java.ast.JavaNode
-import net.sourceforge.pmd.lang.java.ast.ParserTestSpec
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot
import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot
@@ -26,7 +25,7 @@ val JavaNode.typeDsl get() = TypeDslOf(this.typeSystem)
* int[][]: int.toArray(2)
* List extends Number>: List::class[`?` extends Number::class]
*
- * Use [typeDsl] (eg `with(node.typeDsl) { ... }`,
+ * Use [typeDsl] (eg `with(node.typeDsl) { ... }`),
* or [TypeDslOf] (eg `with(TypeDslOf(ts)) { ... }`)
*
* to bring it into scope.
@@ -125,13 +124,14 @@ interface TypeDslMixin {
* List::class[`?` super String::class]
*
*/
+ @Suppress("DANGEROUS_CHARACTERS")
val `?`: WildcardDsl get() = WildcardDsl(ts)
}
/** See [TypeDslMixin.@A]. */
-val ParserTestSpec.GroupTestCtx.VersionedTestCtx.ImplicitNodeParsingCtx<*>.AnnotA
+val AnnotA
get() = "@" + ClassWithTypeAnnotationsInside.A::class.java.canonicalName
class TypeDslOf(override val ts: TypeSystem) : TypeDslMixin
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt
index 99e363d56e..439fb9a03e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeEqualityTest.kt
@@ -10,9 +10,7 @@ import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.kotest.property.checkAll
import io.kotest.property.forAll
-import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
-import net.sourceforge.pmd.lang.java.symbols.internal.forAllEqual
/**
* @author Clément Fournier
@@ -83,7 +81,7 @@ class TypeEqualityTest : FunSpec({
test("Test non well-formed types") {
- val sym = ts.createUnresolvedAsmSymbol("does.not.Exist") as JClassSymbol
+ val sym = ts.createUnresolvedAsmSymbol("does.not.Exist")
// not equal
sym[t_String, t_String] shouldNotBe sym[t_String]
sym[t_String] shouldNotBe sym[t_String, t_String]
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt
index 455c7ba3fd..69260414da 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt
@@ -10,7 +10,9 @@ import io.kotest.property.Arb
import io.kotest.property.Exhaustive
import io.kotest.property.RandomSource
import io.kotest.property.Sample
-import io.kotest.property.arbitrary.*
+import io.kotest.property.arbitrary.arbitrary
+import io.kotest.property.arbitrary.filter
+import io.kotest.property.arbitrary.pair
import io.kotest.property.exhaustive.exhaustive
import net.sourceforge.pmd.lang.java.JavaParsingHelper
import net.sourceforge.pmd.lang.java.ast.ASTTypeParameter
@@ -18,8 +20,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTTypeParameters
import net.sourceforge.pmd.lang.java.ast.ParserTestCtx
import net.sourceforge.pmd.lang.java.symbols.internal.TestClassesGen
import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol
-import javax.lang.model.type.TypeMirror
-import kotlin.streams.toList
+import java.util.stream.Collectors
val TypeSystem.primitiveGen: Exhaustive get() = exhaustive(this.allPrimitives.toList())
@@ -48,7 +49,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() {
// we exclude the null type because it's not ok as an array component
ts.SERIALIZABLE,
ts.CLONEABLE
- );
+ )
override fun edgecase(rs: RandomSource): JTypeMirror {
return allEdgecases.random(rs.random)
@@ -105,7 +106,7 @@ class RefTypeGenArb(val ts: TypeSystem) : Arb() {
-@Suppress("ObjectPropertyName", "MemberVisibilityCanBePrivate")
+@Suppress("MemberVisibilityCanBePrivate", "DANGEROUS_CHARACTERS")
class RefTypeConstants(override val ts: TypeSystem) : TypeDslMixin {
val t_String: JClassType get() = java.lang.String::class.decl
@@ -192,7 +193,7 @@ fun JavaParsingHelper.makeDummyTVars(vararg names: String): List {
.toStream()
.map {
it.typeMirror
- }.toList()
+ }.collect(Collectors.toList())
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt
index 143b993da8..e57b4a7bf4 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeParamSubstTest.kt
@@ -6,8 +6,8 @@ package net.sourceforge.pmd.lang.java.types
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.types.testdata.GenericFbound
import net.sourceforge.pmd.lang.java.types.testdata.MutualTypeRecursion
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt
index a0266f33e4..d4cdbb491d 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeSystemTest.kt
@@ -13,9 +13,9 @@ import io.kotest.matchers.shouldNot
import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.types.shouldBeSameInstanceAs
import io.kotest.matchers.types.shouldNotBeSameInstanceAs
-import net.sourceforge.pmd.lang.ast.test.IntelliMarker
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.IntelliMarker
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.ParserTestCtx
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.symbols.internal.FakeSymAnnot
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt
index 8dbdf6643e..b0a9f22821 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt
@@ -5,7 +5,7 @@
package net.sourceforge.pmd.lang.java.types
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration
import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec
import net.sourceforge.pmd.lang.java.ast.classType
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt
index 0e8c5a6cc3..9785fc2669 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromReflectionTest.kt
@@ -90,6 +90,7 @@ class TypesFromReflectionTest : FunSpec({
}
+ @Suppress("unused")
private class GenericKlass
/**
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt
index b17eeae84e..03ae05f13e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.ast
import io.kotest.assertions.withClue
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.component6
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.component6
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils
import net.sourceforge.pmd.lang.java.types.STRING
@@ -49,7 +49,7 @@ class ConversionContextTests : ProcessorTestSpec({
}
""")
- val (ternary, _, num1, shortCast, num5) = acu.descendants(ASTExpression::class.java).toList()
+ val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList()
spy.shouldBeOk {
// ternary is in double assignment context
@@ -80,7 +80,7 @@ class ConversionContextTests : ProcessorTestSpec({
}
""")
- val (ternary, _, integerCast, nullLit, num4) = acu.descendants(ASTExpression::class.java).toList()
+ val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList()
spy.shouldBeOk {
// ternary is in double assignment context
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt
index 0ab0d87cdb..f97495cb6b 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt
@@ -4,9 +4,9 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol
import net.sourceforge.pmd.lang.java.types.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt
index 3810efe856..95374c4359 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt
@@ -4,14 +4,13 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
-import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.DOUBLE
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT
import net.sourceforge.pmd.lang.java.types.testdata.TypeInferenceTestCases
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
class BranchingExprsTestCases : ProcessorTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt
index b4f84781af..2255c65e03 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt
@@ -5,8 +5,8 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import java.util.*
@@ -476,7 +476,6 @@ public class SubClass {
""".trimIndent()
)
- val cvar = acu.typeVar("C")
val tvar = acu.typeVar("T")
spy.shouldBeOk {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt
index ce73c75bfb..8719732856 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt
@@ -215,7 +215,7 @@ class CtorInferenceTest : ProcessorTestSpec({
""")
- val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures()
+ val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures()
val (innerCtor) = acu.ctorDeclarations().toList()
val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList()
@@ -260,7 +260,7 @@ class CtorInferenceTest : ProcessorTestSpec({
""")
- val (t_Outer, t_Inner, t_Scratch) = acu.declaredTypeSignatures()
+ val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures()
val (innerCtor) = acu.ctorDeclarations().toList()
val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList()
@@ -335,7 +335,7 @@ class CtorInferenceTest : ProcessorTestSpec({
parserTest("Mapping of type params doesn't fail") {
- val (acu, spy) = parser.parseWithTypeInferenceSpy(
+ val (acu, _) = parser.parseWithTypeInferenceSpy(
"""
class Gen {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt
index 519b73f945..2abcd43a66 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.ASTMethodCall
import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec
import net.sourceforge.pmd.lang.java.types.firstMethodCall
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt
index bb2778d52c..d95b755b30 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt
@@ -3,7 +3,7 @@
*/
package net.sourceforge.pmd.lang.java.types.internal.infer
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.ast.JavaVersion.*
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol
@@ -193,7 +193,7 @@ class Java7InferenceTest : ProcessorTestSpec({
})
-private fun TypeDslMixin.ctorInfersTo(
+private fun ctorInfersTo(
call: ASTConstructorCall,
inferredType: JClassType
) {
@@ -204,7 +204,7 @@ private fun TypeDslMixin.ctorInfersTo(
)
}
-private fun TypeDslMixin.methodInfersTo(call: ASTMethodCall, returnType: JClassType) {
+private fun methodInfersTo(call: ASTMethodCall, returnType: JClassType) {
call.methodType.shouldMatchMethod(
named = call.methodName,
declaredIn = null, // not asserted
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt
index 05f5020c71..934ba6e60f 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt
@@ -7,12 +7,15 @@ package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.assertions.withClue
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.*
-import net.sourceforge.pmd.lang.ast.test.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.lang.java.types.internal.infer.ast.JavaExprMirrors
import net.sourceforge.pmd.lang.java.types.testdata.TypeInferenceTestCases
+import net.sourceforge.pmd.lang.test.ast.component6
+import net.sourceforge.pmd.lang.test.ast.component7
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import java.util.function.DoubleConsumer
import java.util.function.Supplier
import kotlin.test.assertEquals
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt
index 26ee2a054c..46c240cb8e 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec
import net.sourceforge.pmd.lang.java.ast.variableAccess
import net.sourceforge.pmd.lang.java.types.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt
index 89a7c79b77..70ca35ff47 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt
@@ -5,10 +5,10 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.component6
-import net.sourceforge.pmd.lang.ast.test.component7
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.component6
+import net.sourceforge.pmd.lang.test.ast.component7
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import java.util.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt
index 43c5863b97..66c8fedcd6 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt
@@ -7,8 +7,8 @@ package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.should
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.lang.java.types.testdata.Overloads
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt
index b936f608d5..a84034f07b 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt
@@ -6,7 +6,7 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.lang.java.types.TypeOps.areOverrideEquivalent
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt
index 4265682cfc..c7f41da2b8 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt
@@ -10,7 +10,6 @@ import io.kotest.matchers.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.util.OptionalBool
-import org.intellij.lang.annotations.Language
import kotlin.test.assertFalse
import kotlin.test.assertTrue
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt
index 73c4dcc101..6405b99afb 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt
@@ -5,8 +5,8 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
import java.io.BufferedOutputStream
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt
index 05ae0ee19a..12e83452f6 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt
@@ -5,12 +5,13 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import io.kotest.matchers.shouldNotBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol
import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol
import net.sourceforge.pmd.lang.java.types.*
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import java.util.function.Supplier
/**
@@ -44,7 +45,7 @@ class SpecialMethodsTest : ProcessorTestSpec({
val t_Scratch = acu.declaredTypeSignatures()[0]
val kvar = acu.typeVar("K")
- val (k, k2, raw, call) = acu.methodCalls().toList()
+ val (k, k2, _, call) = acu.methodCalls().toList()
doTest("Test this::getClass") {
spy.shouldBeOk {
@@ -137,7 +138,7 @@ class SpecialMethodsTest : ProcessorTestSpec({
""".trimIndent())
- val t_Scratch = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror
+ acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null
val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow()
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt
index 51729be664..e7877f7152 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt
@@ -8,16 +8,13 @@ package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.assertions.withClue
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
-import io.kotest.property.arbitrary.filterNot
-import io.kotest.property.checkAll
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.ast.BinaryOp.*
import net.sourceforge.pmd.lang.java.types.*
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.*
import net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
class StandaloneTypesTest : ProcessorTestSpec({
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt
index 587e564fd7..1df6c2b657 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt
@@ -9,8 +9,8 @@ import com.github.oowekyala.treeutils.matchers.TreeNodeWrapper
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import net.sourceforge.pmd.lang.ast.Node
-import net.sourceforge.pmd.lang.ast.test.NodeSpec
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.NodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.JClassType
import net.sourceforge.pmd.lang.java.types.shouldHaveType
@@ -39,7 +39,7 @@ class StressTest : ProcessorTestSpec({
fun TreeNodeWrapper.typeIs(value: Boolean) {
it.typeMirror.shouldBeA {
it.symbol.binaryName shouldBe "net.sourceforge.pmd.lang.java.types.testdata.BoolLogic\$${value.toString()
- .replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }}"
+ .replaceFirstChar { char -> if (char.isLowerCase()) char.titlecase(Locale.getDefault()) else char.toString() }}"
}
}
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt
index b43cc4be6f..05ecc933b9 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt
@@ -8,8 +8,6 @@ package net.sourceforge.pmd.lang.java.types.internal.infer
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
-import net.sourceforge.pmd.lang.java.types.internal.infer.TypeInferenceLogger.VerboseLogger
-import java.util.*
/**
*/
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt
index 8a1e246d74..d7965cd569 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt
@@ -7,10 +7,10 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.NodeSpec
-import net.sourceforge.pmd.lang.ast.test.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.NodeSpec
+import net.sourceforge.pmd.lang.test.ast.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol
import net.sourceforge.pmd.lang.java.types.*
@@ -248,7 +248,7 @@ class Scratch {
}
""".trimIndent())
- val (t_I, t_C) = acu.declaredTypeSignatures()
+ val (_, t_C) = acu.declaredTypeSignatures()
val tParam = acu.typeVariables().first { it.name == "T" }
spy.shouldBeOk {
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt
index 058d0f99ab..42c7061581 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt
@@ -7,7 +7,7 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBe
+import net.sourceforge.pmd.lang.test.ast.shouldBe
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.types.*
diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt
index 9c2b3e147d..5c4bb7f798 100644
--- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt
+++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt
@@ -7,8 +7,8 @@
package net.sourceforge.pmd.lang.java.types.internal.infer
import io.kotest.matchers.shouldBe
-import net.sourceforge.pmd.lang.ast.test.shouldBeA
-import net.sourceforge.pmd.lang.ast.test.shouldMatchN
+import net.sourceforge.pmd.lang.test.ast.shouldBeA
+import net.sourceforge.pmd.lang.test.ast.shouldMatchN
import net.sourceforge.pmd.lang.java.ast.*
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol
import net.sourceforge.pmd.lang.java.types.*
@@ -261,7 +261,7 @@ class C {
val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol }
val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo")
- val t_Bound = idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound")
+ idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound")
val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow()
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml
similarity index 100%
rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/classpathtest/ruleset.xml
rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/classpathtest/ruleset.xml
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml
similarity index 100%
rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/custom_ruleset.xml
rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/custom_ruleset.xml
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml
similarity index 96%
rename from pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml
rename to pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml
index a1abe53864..4378af2f1e 100644
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ant/xml/pmdtasktest.xml
@@ -101,9 +101,7 @@
-
-
-
+
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 00d7c929e5..cef1af04e5 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
@@ -33,7 +33,7 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -85,7 +85,7 @@
| | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -118,7 +118,7 @@
| | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -144,7 +144,7 @@
| | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -169,7 +169,7 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -201,7 +201,7 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- Annotation[@SimpleName = "Deprecated"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"]
@@ -235,7 +235,7 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
| | | +- Annotation[@SimpleName = "Deprecated"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java
deleted file mode 100644
index 69c05218b9..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class DealingWithNull {
-
- static void testFooBar(String s) {
- switch (s) {
- case null -> System.out.println("Oops");
- case "Foo", "Bar" -> System.out.println("Great"); // CaseConstant
- default -> System.out.println("Ok");
- }
- }
-
- static void testStringOrNull(Object o) {
- switch (o) {
- case String s -> System.out.println("String: " + s); // CasePattern
- case null -> System.out.println("null");
- default -> System.out.println("default case");
- }
- }
-
- static void testStringOrDefaultNull(Object o) {
- switch (o) {
- case String s -> System.out.println("String: " + s);
- case null, default -> System.out.println("null or default case");
- }
- }
-
- static void test2(Object o) {
- switch (o) {
- case null -> throw new NullPointerException();
- case String s -> System.out.println("String: "+s);
- case Integer i -> System.out.println("Integer");
- default -> System.out.println("default");
- }
- }
-
-
- static void test3(Object o) {
- switch(o) {
- case null:
- System.out.println("null");
- break; // note: fall-through to a CasePattern is not allowed, as the pattern variable is not initialized
- case String s:
- System.out.println("String");
- break;
- default:
- System.out.println("default case");
- break;
- }
-
- switch(o) {
- case null -> System.out.println("null");
- case String s -> System.out.println("String");
- default -> System.out.println("default case");
- }
-
- switch(o) {
- case null: default:
- System.out.println("The rest (including null)");
- }
-
- switch(o) {
- case null, default ->
- System.out.println("The rest (including null)");
- }
- }
-
- public static void main(String[] args) {
- testStringOrDefaultNull("test");
- test2(2);
- try {
- test2(null);
- } catch (NullPointerException e) {
- System.out.println(e);
- }
- test3(3);
- test3("test");
- test3(null);
-
- testFooBar(null);
- testFooBar("Foo");
- testFooBar("Bar");
- testFooBar("baz");
-
- testStringOrNull(null);
- testStringOrNull("some string");
- }
-}
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
deleted file mode 100644
index 90ec5a71ab..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt
+++ /dev/null
@@ -1,347 +0,0 @@
-+- 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}"]
- +- ClassBody[@Empty = false, @Size = 6]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrDefaultNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null or default case", @Empty = false, @Image = "\"null or default case\"", @Length = 20, @LiteralText = "\"null or default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ThrowStatement[]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default", @Empty = false, @Image = "\"default\"", @Length = 7, @LiteralText = "\"default\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 4, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ExpressionStatement[]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- BreakStatement[@Label = null]
- | | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ExpressionStatement[]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- BreakStatement[@Label = null]
- | | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 12, @containsComment = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- +- TryStatement[@TryWithResources = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- CatchClause[]
- | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bar", @Empty = false, @Image = "\"Bar\"", @Length = 3, @LiteralText = "\"Bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "baz", @Empty = false, @Image = "\"baz\"", @Length = 3, @LiteralText = "\"baz\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "some string", @Empty = false, @Image = "\"some string\"", @Length = 11, @LiteralText = "\"some string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java
deleted file mode 100644
index ed3951e62e..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class EnhancedTypeCheckingSwitch {
-
-
- static void typeTester(Object o) {
- switch (o) {
- case null -> System.out.println("null");
- case String s -> System.out.println("String");
- case Color c -> System.out.println("Color with " + c.values().length + " values");
- case Point p -> System.out.println("Record class: " + p.toString());
- case int[] ia -> System.out.println("Array of ints of length " + ia.length);
- default -> System.out.println("Something else");
- }
- }
-
- public static void main(String[] args) {
- Object o = "test";
- typeTester(o);
- typeTester(Color.BLUE);
-
- o = new int[] {1, 2, 3, 4};
- typeTester(o);
-
- o = new Point(7, 8);
- typeTester(o);
-
- o = new Object();
- typeTester(o);
- }
-}
-
-record Point(int i, int j) {}
-enum Color { RED, GREEN, BLUE; }
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
deleted file mode 100644
index 00c467d2ef..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-+- 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}"]
- | +- ClassBody[@Empty = false, @Size = 2]
- | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | | +- VoidType[]
- | | +- FormalParameters[@Empty = false, @Size = 1]
- | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Color with ", @Empty = false, @Image = "\"Color with \"", @Length = 11, @LiteralText = "\"Color with \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " values", @Empty = false, @Image = "\" values\"", @Length = 7, @LiteralText = "\" values\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Record class: ", @Empty = false, @Image = "\"Record class: \"", @Length = 14, @LiteralText = "\"Record class: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | +- SwitchArrowBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ArrayType[@ArrayDepth = 1]
- | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | | | +- ArrayTypeDim[@Varargs = false]
- | | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Array of ints of length ", @Empty = false, @Image = "\"Array of ints of length \"", @Length = 24, @LiteralText = "\"Array of ints of length \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchArrowBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Something else", @Empty = false, @Image = "\"Something else\"", @Length = 14, @LiteralText = "\"Something else\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 9, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableDeclarator[@Initializer = true, @Name = "o"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | +- ExpressionStatement[]
- | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 4, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4]
- | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ExpressionStatement[]
- | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8]
- | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ExpressionStatement[]
- | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Point", @CanonicalName = "Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
- +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"]
- +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false]
- +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC]
- | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC]
- | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC]
- +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java
deleted file mode 100644
index 3918654e57..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class ExhaustiveSwitch {
-
- static int coverage(Object o) {
- return switch (o) {
- case String s -> s.length();
- case Integer i -> i;
- default -> 0;
- };
- }
-
- static void coverageStatement(Object o) {
- switch (o) {
- case String s:
- System.out.println(s);
- break;
- case Integer i:
- System.out.println("Integer");
- break;
- default: // Now exhaustive!
- break;
- }
- }
-
- sealed interface S permits A, B, C {}
- final static class A implements S {}
- final static class B implements S {}
- record C(int i) implements S {} // Implicitly final
-
- static int testSealedExhaustive(S s) {
- return switch (s) {
- case A a -> 1;
- case B b -> 2;
- case C c -> 3;
- };
- }
-
- static void switchStatementExhaustive(S s) {
- switch (s) {
- case A a :
- System.out.println("A");
- break;
- case C c :
- System.out.println("C");
- break;
- default:
- System.out.println("default case, should be B");
- break;
- };
- }
- sealed interface I permits E, F {}
- final static class E implements I {}
- final static class F implements I {}
-
- static int testGenericSealedExhaustive(I i) {
- return switch (i) {
- // Exhaustive as no E case possible!
- case F bi -> 42;
- };
- }
-
- public static void main(String[] args) {
- System.out.println(coverage("a string"));
- System.out.println(coverage(42));
- System.out.println(coverage(new Object()));
-
- coverageStatement("a string");
- coverageStatement(21);
- coverageStatement(new Object());
-
- System.out.println("A:" + testSealedExhaustive(new A()));
- System.out.println("B:" + testSealedExhaustive(new B()));
- System.out.println("C:" + testSealedExhaustive(new C(1)));
-
- switchStatementExhaustive(new A());
- switchStatementExhaustive(new B());
- switchStatementExhaustive(new C(2));
-
- System.out.println("F:" + testGenericSealedExhaustive(new F()));
- }
-}
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
deleted file mode 100644
index f60c2c795c..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt
+++ /dev/null
@@ -1,365 +0,0 @@
-+- 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}"]
- +- ClassBody[@Empty = false, @Size = 13]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ReturnStatement[]
- | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverageStatement", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- BreakStatement[@Label = null]
- +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"]
- | +- PermitsList[@Empty = false, @Size = 3]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | +- 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"]
- | +- 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"]
- | +- 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]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- ImplementsList[@Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "S"]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "S"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ReturnStatement[]
- | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "S"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ExpressionStatement[]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- BreakStatement[@Label = null]
- | | +- SwitchFallthroughBranch[@Default = false]
- | | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ExpressionStatement[]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C", @Empty = false, @Image = "\"C\"", @Length = 1, @LiteralText = "\"C\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | +- BreakStatement[@Label = null]
- | | +- SwitchFallthroughBranch[@Default = true]
- | | +- SwitchLabel[@Default = true]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case, should be B", @Empty = false, @Image = "\"default case, should be B\"", @Length = 25, @LiteralText = "\"default case, should be B\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- BreakStatement[@Label = null]
- | +- EmptyStatement[]
- +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$I", @CanonicalName = "ExhaustiveSwitch.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}"]
- | +- TypeParameters[@Empty = false, @Size = 1]
- | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false]
- | +- PermitsList[@Empty = false, @Size = 2]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "E"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
- | +- 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]
- | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false]
- | +- ImplementsList[@Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | +- 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]
- | | +- TypeParameter[@Image = "Y", @Name = "Y", @TypeBound = false]
- | +- ImplementsList[@Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Y"]
- | +- ClassBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ReturnStatement[]
- | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 13, @containsComment = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a string", @Empty = false, @Image = "\"a string\"", @Length = 8, @LiteralText = "\"a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "21", @IntLiteral = true, @Integral = true, @LiteralText = "21", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 21.0, @ValueAsFloat = 21.0, @ValueAsInt = 21, @ValueAsLong = 21]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A:", @Empty = false, @Image = "\"A:\"", @Length = 2, @LiteralText = "\"A:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "B:", @Empty = false, @Image = "\"B:\"", @Length = 2, @LiteralText = "\"B:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C:", @Empty = false, @Image = "\"C:\"", @Length = 2, @LiteralText = "\"C:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "F:", @Empty = false, @Image = "\"F:\"", @Length = 2, @LiteralText = "\"F:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodCall[@CompileTimeConstant = false, @Image = "testGenericSealedExhaustive", @MethodName = "testGenericSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- +- ClassType[@FullyQualified = false, @SimpleName = "F"]
- | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- +- ArgumentList[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java
deleted file mode 100644
index 41e2a343fe..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class GuardedAndParenthesizedPatterns {
-
-
- static void test(Object o) {
- switch (o) {
- case String s when s.length() == 1 -> System.out.println("single char string");
- case String s -> System.out.println("string");
- case Integer i when i.intValue() == 1 -> System.out.println("integer 1");
- case (Long l) when l.longValue() == 1L -> System.out.println("long 1 with parens");
- case (((Double d))) -> System.out.println("double with parens");
- default -> System.out.println("default case");
- }
- }
-
- // verify that "when" can still be used as an identifier -> formal parameter
- void testIdentifierWhen(String when) {
- System.out.println(when);
- }
-
- // verify that "when" can still be used as an identifier -> local variable
- void testIdentifierWhen() {
- int when = 1;
- System.out.println(when);
- }
-
- // verify that "when" can still be used as a type name
- private static class when {}
-
- static void testWithNull(Object o) {
- switch (o) {
- case String s when (s.length() == 1) -> System.out.println("single char string");
- case String s -> System.out.println("string");
- case (Integer i) when i.intValue() == 1 -> System.out.println("integer 1");
- case ((Long l)) when ((l.longValue() == 1L)) -> System.out.println("long 1 with parens");
- case (((Double d))) -> System.out.println("double with parens");
- case null -> System.out.println("null!");
- default -> System.out.println("default case");
- }
- }
-
-
- static void instanceOfPattern(Object o) {
- if (o instanceof String s && s.length() > 2) {
- System.out.println("A string containing at least two characters");
- }
- if (o != null && (o instanceof String s && s.length() > 3)) {
- System.out.println("A string containing at least three characters");
- }
-
- // note: with this 3rd preview, the following is not allowed anymore:
- // if (o instanceof (String s && s.length() > 4)) {
- // > An alternative to guarded pattern labels is to support guarded patterns directly as a special pattern form,
- // > e.g. p && e. Having experimented with this in previous previews, the resulting ambiguity with boolean
- // > expressions have lead us to prefer when clauses in pattern switches.
- if ((o instanceof String s) && (s.length() > 4)) {
- System.out.println("A string containing at least four characters");
- }
- }
-
- static void testScopeOfPatternVariableDeclarations(Object obj) {
- if ((obj instanceof String s) && s.length() > 3) {
- System.out.println(s);
- } else {
- System.out.println("Not a string");
- }
- }
-
- public static void main(String[] args) {
- test("a");
- test("fooo");
- test(1);
- test(1L);
- instanceOfPattern("abcde");
- try {
- test(null); // throws NPE
- } catch (NullPointerException e) {
- e.printStackTrace();
- }
- testWithNull(null);
- testScopeOfPatternVariableDeclarations("a");
- testScopeOfPatternVariableDeclarations("long enough");
- }
-}
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
deleted file mode 100644
index f923ef63d7..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt
+++ /dev/null
@@ -1,422 +0,0 @@
-+- 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}"]
- +- ClassBody[@Empty = false, @Size = 8]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = true, @Size = 0]
- | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableDeclarator[@Initializer = true, @Name = "when"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- 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}"]
- | +- ClassBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 1, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 2, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long 1 with parens", @Empty = false, @Image = "\"long 1 with parens\"", @Length = 18, @LiteralText = "\"long 1 with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 3, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double with parens", @Empty = false, @Image = "\"double with parens\"", @Length = 18, @LiteralText = "\"double with parens\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null!", @Empty = false, @Image = "\"null!\"", @Length = 5, @LiteralText = "\"null!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "instanceOfPattern", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 3, @containsComment = false]
- | +- IfStatement[@Else = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @Empty = false, @Image = "\"A string containing at least two characters\"", @Length = 43, @LiteralText = "\"A string containing at least two characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- IfStatement[@Else = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.NE, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 1, @Parenthesized = true]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @Empty = false, @Image = "\"A string containing at least three characters\"", @Length = 45, @LiteralText = "\"A string containing at least three characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @Empty = false, @Image = "\"A string containing at least four characters\"", @Length = 44, @LiteralText = "\"A string containing at least four characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testScopeOfPatternVariableDeclarations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = true]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a string", @Empty = false, @Image = "\"Not a string\"", @Length = 12, @LiteralText = "\"Not a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 9, @containsComment = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fooo", @Empty = false, @Image = "\"fooo\"", @Length = 4, @LiteralText = "\"fooo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LiteralText = "1L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "instanceOfPattern", @MethodName = "instanceOfPattern", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "abcde", @Empty = false, @Image = "\"abcde\"", @Length = 5, @LiteralText = "\"abcde\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- TryStatement[@TryWithResources = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = true]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- CatchClause[]
- | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long enough", @Empty = false, @Image = "\"long enough\"", @Length = 11, @LiteralText = "\"long enough\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java
deleted file mode 100644
index 210c03f066..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class PatternsInSwitchLabels {
-
-
- public static void main(String[] args) {
- Object o = 123L;
- String formatted = switch (o) {
- case Integer i -> String.format("int %d", i);
- case Long l -> String.format("long %d", l);
- case Double d -> String.format("double %f", d);
- case String s -> String.format("String %s", s);
- default -> o.toString();
- };
- System.out.println(formatted);
- }
-}
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
deleted file mode 100644
index abb2f972ed..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-+- 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}"]
- +- ClassBody[@Empty = false, @Size = 1]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 3, @containsComment = false]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | +- VariableDeclarator[@Initializer = true, @Name = "o"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | +- VariableDeclarator[@Initializer = true, @Name = "formatted"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "formatted", @Name = "formatted", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java
deleted file mode 100644
index 2ae278af1e..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 432: Record Patterns (Second Preview)
- */
-public class RecordPatterns {
-
- record Point(int x, int y) {}
- enum Color { RED, GREEN, BLUE }
- record ColoredPoint(Point p, Color c) {}
- record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {}
-
- void printSum1(Object o) {
- if (o instanceof Point p) {
- int x = p.x();
- int y = p.y();
- System.out.println(x+y);
- }
- }
-
- // record pattern
- void printSum2(Object o) {
- if (o instanceof Point(int x, int y)) {
- System.out.println(x+y);
- }
- }
-
- void printUpperLeftColoredPoint(Rectangle r) {
- if (r instanceof Rectangle(ColoredPoint ul, ColoredPoint lr)) {
- System.out.println(ul.c());
- }
- }
-
- // nested record pattern
- void printColorOfUpperLeftPoint(Rectangle r) {
- if (r instanceof Rectangle(ColoredPoint(Point p, Color c),
- ColoredPoint lr)) {
- System.out.println(c);
- }
- }
-
- Rectangle createRectangle(int x1, int y1, Color c1, int x2, int y2, Color c2) {
- Rectangle r = new Rectangle(new ColoredPoint(new Point(x1, y1), c1),
- new ColoredPoint(new Point(x2, y2), c2));
- return r;
- }
-
- // fully nested record pattern, also using "var"
- void printXCoordOfUpperLeftPointWithPatterns(Rectangle r) {
- if (r instanceof Rectangle(ColoredPoint(Point(var x, var y), var c),
- var lr)) {
- System.out.println("Upper-left corner: " + x);
- }
- }
-
- record Pair(Object x, Object y) {}
- void nestedPatternsCanFailToMatch() {
- Pair p = new Pair(42, 42);
- if (p instanceof Pair(String s, String t)) {
- System.out.println(s + ", " + t);
- } else {
- System.out.println("Not a pair of strings");
- }
- }
-
- // record patterns with generic types
- record Box(T t) {}
- void test1a(Box bo) {
- if (bo instanceof Box(String s)) {
- System.out.println("String " + s);
- }
- }
- void test1(Box bo) {
- if (bo instanceof Box(var s)) {
- System.out.println("String " + s);
- }
- }
-
- // type argument is inferred
- void test2(Box bo) {
- if (bo instanceof Box(var s)) { // Inferred to be Box(var s)
- System.out.println("String " + s);
- }
- }
-
- // nested record patterns
- void test3(Box> bo) {
- if (bo instanceof Box>(Box(var s))) {
- System.out.println("String " + s);
- }
- }
-
- void test4(Box> bo) {
- if (bo instanceof Box(Box(var s))) {
- System.out.println("String " + s);
- }
- }
-}
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
deleted file mode 100644
index 7e0d61f1ad..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt
+++ /dev/null
@@ -1,557 +0,0 @@
-+- 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}"]
- +- 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]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC]
- | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC]
- | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC]
- | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 3, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableDeclarator[@Initializer = true, @Name = "x"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableDeclarator[@Initializer = true, @Name = "y"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printUpperLeftColoredPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "createRectangle", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | +- FormalParameters[@Empty = false, @Size = 6]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- VariableDeclarator[@Initializer = true, @Name = "r"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- ArgumentList[@Empty = false, @Size = 2]
- | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | | +- ArgumentList[@Empty = false, @Size = 2]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | +- ArgumentList[@Empty = false, @Size = 2]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ReturnStatement[]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | | +- PatternList[@Empty = false, @Size = 2]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Pair", @CanonicalName = "RecordPatterns.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 = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = true, @Size = 0]
- | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- VariableDeclarator[@Initializer = true, @Name = "p"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
- | +- IfStatement[@Else = true]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.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]
- | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false]
- | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "T"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- IfStatement[@Else = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- PatternList[@Empty = false, @Size = 1]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 1, @containsComment = false]
- +- IfStatement[@Else = false]
- +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | +- PatternList[@Empty = false, @Size = 1]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
- | +- PatternList[@Empty = false, @Size = 1]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 1, @containsComment = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java
deleted file mode 100644
index 7fb9f1250e..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 432: Record Patterns (Second Preview)
- */
-public class RecordPatternsExhaustiveSwitch {
- class A {}
- class B extends A {}
- sealed interface I permits C, D {}
- final class C implements I {}
- final class D implements I {}
- record Pair(T x, T y) {}
-
- static void test() {
- Pair p1 = null;
- Pair p2 = null;
-
- switch (p1) { // Error!
- case Pair(A a, B b) -> System.out.println("a");
- case Pair (B b, A a) -> System.out.println("a");
- case Pair (A a1, A a2) -> System.out.println("exhaustive now"); // without this case, compile error
- }
-
- switch (p2) {
- case Pair(I i, C c) -> System.out.println("a");
- case Pair(I i, D d) -> System.out.println("a");
- }
-
- switch (p2) {
- case Pair(C c, I i) -> System.out.println("a");
- case Pair(D d, C c) -> System.out.println("a");
- case Pair(D d1, D d2) -> System.out.println("a");
- }
- }
-}
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
deleted file mode 100644
index 3c87e4ce4a..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt
+++ /dev/null
@@ -1,237 +0,0 @@
-+- 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}"]
- +- 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 = "{}"]
- | +- 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"]
- | +- 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"]
- | +- 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"]
- | +- 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"]
- | +- 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]
- | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "T"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = true, @Size = 0]
- +- Block[@Empty = false, @Size = 5, @containsComment = false]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | +- VariableDeclarator[@Initializer = true, @Name = "p1"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | +- VariableDeclarator[@Initializer = true, @Name = "p2"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "exhaustive now", @Empty = false, @Image = "\"exhaustive now\"", @Length = 14, @LiteralText = "\"exhaustive now\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
- +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- SwitchArrowBranch[@Default = false]
- | +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- SwitchArrowBranch[@Default = false]
- +- SwitchLabel[@Default = false]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
- | +- PatternList[@Empty = false, @Size = 2]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java
deleted file mode 100644
index 0f3b5f2274..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 432: Record Patterns (Second Preview)
- */
-public class RecordPatternsInEnhancedFor {
- record Point(int x, int y) {}
- enum Color { RED, GREEN, BLUE }
- record ColoredPoint(Point p, Color c) {}
- record Rectangle(ColoredPoint upperLeft, ColoredPoint lowerRight) {}
-
- // record patterns in for-each loop (enhanced for statement)
- static void dump(Point[] pointArray) {
- for (Point(var x, var y) : pointArray) { // Record Pattern in header!
- System.out.println("(" + x + ", " + y + ")");
- }
- }
-
- // nested record patterns in enhanced for statement
- static void printUpperLeftColors(Rectangle[] r) {
- for (Rectangle(ColoredPoint(Point p, Color c), ColoredPoint lr): r) {
- System.out.println(c);
- }
- }
-
- record Pair(Object fst, Object snd){}
- static void exceptionTest() {
- Pair[] ps = new Pair[]{
- new Pair(1,2),
- null,
- new Pair("hello","world")
- };
- for (Pair(var f, var s): ps) { // Run-time MatchException
- System.out.println(f + " -> " + s);
- }
- }
-
- public static void main(String[] args) {
- exceptionTest();
- }
-}
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
deleted file mode 100644
index 7d7e0b52c2..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt
+++ /dev/null
@@ -1,215 +0,0 @@
-+- 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}"]
- +- 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]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Color", @CanonicalName = "RecordPatternsInEnhancedFor.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC]
- | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC]
- | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC]
- | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @CanonicalName = "RecordPatternsInEnhancedFor.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Rectangle", @CanonicalName = "RecordPatternsInEnhancedFor.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
- | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "dump", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ForeachStatement[]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pointArray", @Name = "pointArray", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(", @Empty = false, @Image = "\"(\"", @Length = 1, @LiteralText = "\"(\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ")", @Empty = false, @Image = "\")\"", @Length = 1, @LiteralText = "\")\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printUpperLeftColors", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ForeachStatement[]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$Pair", @CanonicalName = "RecordPatternsInEnhancedFor.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 = "{}"]
- | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
- | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- RecordBody[@Empty = true, @Size = 0]
- +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exceptionTest", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = true, @Size = 0]
- | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- VariableDeclarator[@Initializer = true, @Name = "ps"]
- | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArrayType[@ArrayDepth = 1]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | | +- ArrayTypeDim[@Varargs = false]
- | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | | +- ArgumentList[@Empty = false, @Size = 2]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- ArgumentList[@Empty = false, @Size = 2]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hello", @Empty = false, @Image = "\"hello\"", @Length = 5, @LiteralText = "\"hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "world", @Empty = false, @Image = "\"world\"", @Length = 5, @LiteralText = "\"world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- ForeachStatement[]
- | +- RecordPattern[@ParenthesisDepth = 0]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
- | | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ps", @Name = "ps", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " -> ", @Empty = false, @Image = "\" -> \"", @Length = 4, @LiteralText = "\" -> \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 1, @containsComment = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "exceptionTest", @MethodName = "exceptionTest", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java
deleted file mode 100644
index c2eadc6711..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class RefiningPatternsInSwitch {
-
- static class Shape {}
- static class Rectangle extends Shape {}
- static class Triangle extends Shape {
- private int area;
- Triangle(int area) {
- this.area = area;
- }
- int calculateArea() { return area; }
- }
-
- static void testTriangle(Shape s) {
- switch (s) {
- case null:
- break;
- case Triangle t:
- if (t.calculateArea() > 100) {
- System.out.println("Large triangle");
- break;
- }
- default:
- System.out.println("A shape, possibly a small triangle");
- }
- }
-
- static void testTriangleRefined(Shape s) {
- switch (s) {
- case null ->
- { break; }
- case Triangle t
- when t.calculateArea() > 100 ->
- System.out.println("Large triangle");
- default ->
- System.out.println("A shape, possibly a small triangle");
- }
- }
-
- static void testTriangleRefined2(Shape s) {
- switch (s) {
- case null ->
- { break; }
- case Triangle t
- when t.calculateArea() > 100 ->
- System.out.println("Large triangle");
- case Triangle t ->
- System.out.println("Small triangle");
- default ->
- System.out.println("Non-triangle");
- }
- }
-
- public static void main(String[] args) {
- Triangle large = new Triangle(200);
- Triangle small = new Triangle(10);
- Rectangle rect = new Rectangle();
-
- testTriangle(large);
- testTriangle(small);
- testTriangle(rect);
-
- testTriangleRefined(large);
- testTriangleRefined(small);
- testTriangleRefined(rect);
-
- testTriangleRefined2(large);
- testTriangleRefined2(small);
- testTriangleRefined2(rect);
- }
-}
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
deleted file mode 100644
index 800addcdf0..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt
+++ /dev/null
@@ -1,257 +0,0 @@
-+- 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}"]
- +- 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}"]
- | +- 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"]
- | +- 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"]
- | +- 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]
- | | +- VariableDeclarator[@Initializer = false, @Name = "area"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
- | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Triangle", @Name = "Triangle", @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- FormalParameters[@Empty = false, @Size = 1]
- | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- ExpressionStatement[]
- | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "calculateArea", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
- | +- FormalParameters[@Empty = true, @Size = 0]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ReturnStatement[]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangle", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- IfStatement[@Else = false]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100]
- | | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Small triangle", @Empty = false, @Image = "\"Small triangle\"", @Length = 14, @LiteralText = "\"Small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Non-triangle", @Empty = false, @Image = "\"Non-triangle\"", @Length = 12, @LiteralText = "\"Non-triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 12, @containsComment = false]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | +- VariableDeclarator[@Initializer = true, @Name = "large"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LiteralText = "200", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | +- VariableDeclarator[@Initializer = true, @Name = "small"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10]
- +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | +- VariableDeclarator[@Initializer = true, @Name = "rect"]
- | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
- | +- ArgumentList[@Empty = true, @Size = 0]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java
deleted file mode 100644
index d65340e4da..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-/**
- * @see JEP 433: Pattern Matching for switch (Fourth Preview)
- */
-public class ScopeOfPatternVariableDeclarations {
-
- static void testSwitchBlock(Object obj) {
- switch (obj) {
- case Character c
- when c.charValue() == 7:
- System.out.println("Ding!");
- break;
- default:
- break;
- }
- }
-
- static void testSwitchRule(Object o) {
- switch (o) {
- case Character c -> {
- if (c.charValue() == 7) {
- System.out.println("Ding!");
- }
- System.out.println("Character");
- }
- case Integer i ->
- throw new IllegalStateException("Invalid Integer argument of value " + i.intValue());
- default -> {
- break;
- }
- }
- }
-
-
- static void test2(Object o) {
- switch (o) {
- case Character c:
- if (c.charValue() == 7) {
- System.out.print("Ding ");
- }
- if (c.charValue() == 9) {
- System.out.print("Tab ");
- }
- System.out.println("character");
- default:
- System.out.println("fall-through");
- }
- }
-
-
- public static void main(String[] args) {
- testSwitchBlock('\u0007');
- testSwitchRule('A');
- try {
- testSwitchRule(42); // throws
- } catch (IllegalStateException e) {
- System.out.println(e);
- }
- test2('\t');
- }
-}
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
deleted file mode 100644
index e51ef27eda..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt
+++ /dev/null
@@ -1,200 +0,0 @@
-+- 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}"]
- +- ClassBody[@Empty = false, @Size = 4]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
- | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- Guard[]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
- | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- BreakStatement[@Label = null]
- | +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- BreakStatement[@Label = null]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchRule", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- Block[@Empty = false, @Size = 2, @containsComment = false]
- | | +- IfStatement[@Else = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
- | | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchArrowBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- ThrowStatement[]
- | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @Empty = false, @Image = "\"Invalid Integer argument of value \"", @Length = 34, @LiteralText = "\"Invalid Integer argument of value \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = true, @Size = 0]
- | +- SwitchArrowBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- BreakStatement[@Label = null]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
- | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
- | +- VoidType[]
- | +- FormalParameters[@Empty = false, @Size = 1]
- | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- SwitchFallthroughBranch[@Default = false]
- | | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
- | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
- | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- IfStatement[@Else = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7]
- | | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding ", @Empty = false, @Image = "\"Ding \"", @Length = 5, @LiteralText = "\"Ding \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- IfStatement[@Else = false]
- | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | | +- ArgumentList[@Empty = true, @Size = 0]
- | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9]
- | | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | | | +- ExpressionStatement[]
- | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | | +- ArgumentList[@Empty = false, @Size = 1]
- | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tab ", @Empty = false, @Image = "\"Tab \"", @Length = 4, @LiteralText = "\"Tab \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "character", @Empty = false, @Image = "\"character\"", @Length = 9, @LiteralText = "\"character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | +- SwitchFallthroughBranch[@Default = true]
- | +- SwitchLabel[@Default = true]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fall-through", @Empty = false, @Image = "\"fall-through\"", @Length = 12, @LiteralText = "\"fall-through\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
- +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
- +- VoidType[]
- +- FormalParameters[@Empty = false, @Size = 1]
- | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
- | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | +- ArrayType[@ArrayDepth = 1]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
- | | +- ArrayDimensions[@Empty = false, @Size = 1]
- | | +- ArrayTypeDim[@Varargs = false]
- | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- +- Block[@Empty = false, @Size = 4, @containsComment = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\u0007\'", @LiteralText = "\'\u0007\'", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- CharLiteral[@CompileTimeConstant = true, @Image = "\'A\'", @LiteralText = "\'A\'", @ParenthesisDepth = 0, @Parenthesized = false]
- +- TryStatement[@TryWithResources = false]
- | +- Block[@Empty = false, @Size = 1, @containsComment = true]
- | | +- ExpressionStatement[]
- | | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ArgumentList[@Empty = false, @Size = 1]
- | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
- | +- CatchClause[]
- | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE]
- | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"]
- | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
- | +- Block[@Empty = false, @Size = 1, @containsComment = false]
- | +- ExpressionStatement[]
- | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
- | +- ArgumentList[@Empty = false, @Size = 1]
- | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ExpressionStatement[]
- +- MethodCall[@CompileTimeConstant = false, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false]
- +- ArgumentList[@Empty = false, @Size = 1]
- +- CharLiteral[@CompileTimeConstant = true, @Image = "\'\\t\'", @LiteralText = "\'\\t\'", @ParenthesisDepth = 0, @Parenthesized = false]
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 90ec5a71ab..c0f15806af 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
@@ -53,7 +53,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -95,7 +95,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -136,7 +136,7 @@
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -150,7 +150,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -192,7 +192,7 @@
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -227,7 +227,7 @@
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- SwitchArrowBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 ea36cde53a..9ebc269936 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
@@ -48,7 +48,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -60,7 +60,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -76,7 +76,7 @@
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -92,7 +92,7 @@
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ArrayType[@ArrayDepth = 1]
| | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
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 a62132bff0..06e21ac6e4 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
@@ -16,7 +16,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -25,7 +25,7 @@
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -46,7 +46,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -60,7 +60,7 @@
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -116,21 +116,21 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -148,7 +148,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchFallthroughBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -162,7 +162,7 @@
| | | +- BreakStatement[@Label = null]
| | +- SwitchFallthroughBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -227,7 +227,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
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 9b3deddd57..9d0c0e74fe 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
@@ -15,7 +15,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -33,7 +33,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -45,7 +45,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -119,7 +119,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -137,7 +137,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -149,7 +149,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -196,7 +196,7 @@
| | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -222,7 +222,7 @@
| | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -244,7 +244,7 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -275,7 +275,7 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 646dad960d..1a3f366681 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
@@ -27,14 +27,14 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -97,21 +97,21 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -136,28 +136,28 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | | +- PatternList[@Empty = false, @Size = 2]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -202,14 +202,14 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -265,14 +265,14 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -309,17 +309,17 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -350,13 +350,13 @@
+- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false]
| +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- RecordPattern[@ParenthesisDepth = 0]
+ | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1]
- | +- RecordPattern[@ParenthesisDepth = 0]
+ | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 2dd50e02ab..dcfeefbe4d 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
@@ -16,7 +16,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -28,7 +28,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -40,7 +40,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -52,7 +52,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -122,7 +122,7 @@
| | +- Block[@Empty = true, @Size = 0, @containsComment = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -141,7 +141,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -160,7 +160,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -213,7 +213,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -232,7 +232,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -251,7 +251,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -304,7 +304,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -324,7 +324,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -344,7 +344,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -364,7 +364,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -378,7 +378,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -455,7 +455,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 abb2f972ed..ce62ae92dc 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
@@ -29,7 +29,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -41,7 +41,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -53,7 +53,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -65,7 +65,7 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 7e0d61f1ad..1db00066df 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
@@ -63,7 +63,7 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -106,14 +106,14 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -140,14 +140,14 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -174,21 +174,21 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -270,28 +270,28 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | | +- PatternList[@Empty = false, @Size = 2]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -336,14 +336,14 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -392,12 +392,12 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -426,12 +426,12 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -460,10 +460,10 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -494,17 +494,17 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -535,13 +535,13 @@
+- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | +- RecordPattern[@ParenthesisDepth = 0]
+ | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1]
- | +- RecordPattern[@ParenthesisDepth = 0]
+ | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "var"]
| +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 3c87e4ce4a..bee481fa9c 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
@@ -65,16 +65,16 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -86,16 +86,16 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -107,16 +107,16 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "A"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -130,16 +130,16 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -151,16 +151,16 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -174,16 +174,16 @@
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false]
+- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -195,16 +195,16 @@
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "C"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -216,16 +216,16 @@
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- SwitchArrowBranch[@Default = false]
+- SwitchLabel[@Default = false]
- | +- RecordPattern[@ParenthesisDepth = 0]
+ | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @SimpleName = "Pair"]
| | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | +- ClassType[@FullyQualified = false, @SimpleName = "I"]
| +- PatternList[@Empty = false, @Size = 2]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "D"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "D"]
| +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 800addcdf0..6cb3616f8f 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
@@ -57,7 +57,7 @@
| | +- BreakStatement[@Label = null]
| +- SwitchFallthroughBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -103,7 +103,7 @@
| | +- BreakStatement[@Label = null]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -145,7 +145,7 @@
| | +- BreakStatement[@Label = null]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -163,7 +163,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 e51ef27eda..70447ca705 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
@@ -15,7 +15,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -49,7 +49,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -77,7 +77,7 @@
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -107,7 +107,7 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchFallthroughBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
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 ba9fb0bb3c..cbe8f11d45 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
@@ -48,11 +48,11 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} \\{"]
+ | | +- TemplateFragment[@Content = "} \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -61,11 +61,11 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -83,15 +83,15 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} + \\{"]
+ | | +- TemplateFragment[@Content = "} + \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} = \\{"]
+ | | +- TemplateFragment[@Content = "} = \\{"]
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -100,10 +100,10 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"You have a \\{"]
+ | | +- TemplateFragment[@Content = "\"You have a \\{"]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ArgumentList[@Empty = true, @Size = 0]
- | | +- TemplateFragment[@Image = "} waiting for you!\""]
+ | | +- TemplateFragment[@Content = "} waiting for you!\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Request"]
@@ -123,16 +123,16 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"Access at \\{"]
+ | | +- TemplateFragment[@Content = "\"Access at \\{"]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} \\{"]
+ | | +- TemplateFragment[@Content = "} \\{"]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} from \\{"]
+ | | +- TemplateFragment[@Content = "} from \\{"]
| | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -175,16 +175,16 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"The file \\{"]
+ | | +- TemplateFragment[@Content = "\"The file \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} \\{"]
+ | | +- TemplateFragment[@Content = "} \\{"]
| | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- ArgumentList[@Empty = true, @Size = 0]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
- | | +- TemplateFragment[@Image = "} exist\""]
+ | | +- TemplateFragment[@Content = "} exist\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -193,7 +193,7 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"The time is \\{"]
+ | | +- TemplateFragment[@Content = "\"The time is \\{"]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
@@ -205,7 +205,7 @@
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"]
| | | +- ArgumentList[@Empty = true, @Size = 0]
- | | +- TemplateFragment[@Image = "} right now\""]
+ | | +- TemplateFragment[@Content = "} right now\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
@@ -220,19 +220,19 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ArrayType[@ArrayDepth = 1]
@@ -253,24 +253,24 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- Template[]
- | | | +- TemplateFragment[@Image = "\"\\{"]
+ | | | +- TemplateFragment[@Content = "\"\\{"]
| | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | | +- TemplateFragment[@Image = "}, \\{"]
+ | | | +- TemplateFragment[@Content = "}, \\{"]
| | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | | | +- TemplateFragment[@Image = "}\""]
- | | +- TemplateFragment[@Image = "}\""]
+ | | | +- TemplateFragment[@Content = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -279,24 +279,24 @@
| +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Template[]
- | +- TemplateFragment[@Image = "\"\\{"]
+ | +- TemplateFragment[@Content = "\"\\{"]
| +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "}, \\{"]
+ | +- TemplateFragment[@Content = "}, \\{"]
| +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\\{"]
+ | | +- TemplateFragment[@Content = "\"\\{"]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | | +- TemplateFragment[@Image = "}, \\{"]
+ | | +- TemplateFragment[@Content = "}, \\{"]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | | +- TemplateFragment[@Image = "}\""]
- | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- TemplateFragment[@Content = "}\""]
+- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
| +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -329,11 +329,11 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"\"\"\n \n \n \\{"]
+ | | +- TemplateFragment[@Content = "\"\"\"\n \n \n \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "title", @Name = "title", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "} \n \n \n \\{"]
+ | | +- TemplateFragment[@Content = "}\n \n
\n \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}
\n \n \n \"\"\""]
+ | | +- TemplateFragment[@Content = "}
\n \n \n \"\"\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -360,76 +360,76 @@
| +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Template[]
- | +- TemplateFragment[@Image = "\"\"\"\n {\n \"name\": \"\\{"]
+ | +- TemplateFragment[@Content = "\"\"\"\n {\n \"name\": \"\\{"]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TemplateFragment[@Image = "}\",\n \"phone\": \"\\{"]
+ | +- TemplateFragment[@Content = "}\",\n \"phone\": \"\\{"]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TemplateFragment[@Image = "}\",\n \"address\": \"\\{"]
+ | +- TemplateFragment[@Content = "}\",\n \"address\": \"\\{"]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "address", @Name = "address", @ParenthesisDepth = 0, @Parenthesized = false]
- | +- TemplateFragment[@Image = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"]
+ | +- TemplateFragment[@Content = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n \\{"]
+ | +- TemplateFragment[@Content = "}\n \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n \\{"]
+ | +- TemplateFragment[@Content = "}\n \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} \\{"]
+ | +- TemplateFragment[@Content = "} \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n Total \\{"]
+ | +- TemplateFragment[@Content = "}\n Total \\{"]
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -447,7 +447,7 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n \"\"\""]
+ | +- TemplateFragment[@Content = "}\n \"\"\""]
+- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
| +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
| +- VoidType[]
@@ -520,75 +520,75 @@
| +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Template[]
- | +- TemplateFragment[@Image = "\"\"\"\n Description Width Height Area\n %-12s\\{"]
+ | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n %-12s\\{"]
+ | +- TemplateFragment[@Content = "}\n %-12s\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n %-12s\\{"]
+ | +- TemplateFragment[@Content = "}\n %-12s\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
- | +- TemplateFragment[@Image = "} %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n \\{"]
+ | +- TemplateFragment[@Content = "}\n \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| | +- ArgumentList[@Empty = false, @Size = 1]
| | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28]
- | +- TemplateFragment[@Image = "} Total %7.2f\\{"]
+ | +- TemplateFragment[@Content = "} Total %7.2f\\{"]
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -606,7 +606,7 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\n \"\"\""]
+ | +- TemplateFragment[@Content = "}\n \"\"\""]
+- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
| +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
| +- VoidType[]
@@ -626,9 +626,9 @@
| | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- Template[]
- | | +- TemplateFragment[@Image = "\"My name is \\{"]
+ | | +- TemplateFragment[@Content = "\"My name is \\{"]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- TemplateFragment[@Image = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
| +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| +- ClassType[@FullyQualified = false, @SimpleName = "String"]
@@ -681,15 +681,15 @@
| +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
| +- Template[]
- | +- TemplateFragment[@Image = "\"Welcome, \\{"]
+ | +- TemplateFragment[@Content = "\"Welcome, \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}, to your account \\{"]
+ | +- TemplateFragment[@Content = "}, to your account \\{"]
| +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
- | +- TemplateFragment[@Image = "}\""]
+ | +- TemplateFragment[@Content = "}\""]
+- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+- VoidType[]
@@ -703,5 +703,5 @@
+- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+- Template[]
- +- TemplateFragment[@Image = "\"Test \\{"]
- +- TemplateFragment[@Image = "}\""]
+ +- TemplateFragment[@Content = "\"Test \\{"]
+ +- TemplateFragment[@Content = "}\""]
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 d15b0ab2ef..c42b1cc26f 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
@@ -67,14 +67,14 @@
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -98,21 +98,21 @@
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
| | +- PatternList[@Empty = false, @Size = 2]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
| | | +- PatternList[@Empty = false, @Size = 2]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | +- UnnamedPattern[@ParenthesisDepth = 0]
+ | | +- UnnamedPattern[]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- ExpressionStatement[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
@@ -182,10 +182,10 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -194,10 +194,10 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -206,10 +206,10 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- PatternList[@Empty = false, @Size = 1]
- | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
| | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -219,17 +219,17 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | | +- RecordPattern[]
| | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
| | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -238,10 +238,10 @@
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- SwitchArrowBranch[@Default = false]
| | | +- SwitchLabel[@Default = false]
- | | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -249,10 +249,10 @@
| | | +- ArgumentList[@Empty = true, @Size = 0]
| | +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | +- PatternList[@Empty = false, @Size = 1]
- | | | +- UnnamedPattern[@ParenthesisDepth = 0]
+ | | | +- UnnamedPattern[]
| | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ArgumentList[@Empty = true, @Size = 0]
| +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -265,17 +265,17 @@
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| | +- SwitchLabel[@Default = false]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
- | | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | | +- RecordPattern[]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | | | +- PatternList[@Empty = false, @Size = 1]
- | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @ParenthesisDepth = 0, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
| | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
| | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
@@ -288,10 +288,10 @@
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
| +- SwitchArrowBranch[@Default = false]
| +- SwitchLabel[@Default = false]
- | | +- RecordPattern[@ParenthesisDepth = 0]
+ | | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
| | +- PatternList[@Empty = false, @Size = 1]
- | | +- UnnamedPattern[@ParenthesisDepth = 0]
+ | | +- UnnamedPattern[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false]
| +- ArgumentList[@Empty = true, @Size = 0]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java
deleted file mode 100644
index 7d690d41e5..0000000000
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables2.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-
-import java.util.ArrayDeque;
-import java.util.List;
-import java.util.Queue;
-import java.util.stream.Collectors;
-
-/**
- * @see JEP 443: Unnamed Patterns and Variables (Preview)
- */
-class Jep443_UnamedPatternsAndVariables2 {
- record Point(int x, int y) { }
- enum Color { RED, GREEN, BLUE }
- record ColoredPoint(Point p, Color c) { }
-
- void unnamedPatterns1() {
- ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN);
-
- if (r instanceof ColoredPoint(Point(int x, int y), _)) {
- System.out.println(x + " " + y);
- }
- }
-}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java
new file mode 100644
index 0000000000..a9d8cb8004
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.java
@@ -0,0 +1,124 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+
+import java.util.ArrayDeque;
+import java.util.List;
+import java.util.Queue;
+import java.util.stream.Collectors;
+
+/**
+ * @see JEP 443: Unnamed Patterns and Variables (Preview) (Java 21)
+ * @see JEP 456: Unnamed Variables & Patterns (Java 22)
+ */
+class Jep456_UnamedPatternsAndVariables {
+ record Point(int x, int y) { }
+ enum Color { RED, GREEN, BLUE }
+ record ColoredPoint(Point p, Color c) { }
+
+ void unnamedPatterns1() {
+ ColoredPoint r = new ColoredPoint(new Point(3,4), Color.GREEN);
+
+ if (r instanceof ColoredPoint(Point p, Color _)) {
+ System.out.println(p.x() + " " + p.y());
+ }
+
+ if (r instanceof ColoredPoint(Point(int x, int y), _)) {
+ System.out.println(x + " " + y);
+ }
+ }
+
+ sealed abstract class Ball permits RedBall, BlueBall, GreenBall { }
+ final class RedBall extends Ball { }
+ final class BlueBall extends Ball { }
+ final class GreenBall extends Ball { }
+
+ record Box(T content) { }
+
+ void unnamedPatterns2() {
+ Box extends Ball> b = new Box<>(new RedBall());
+ switch (b) {
+ case Box(RedBall _) -> processBox(b);
+ case Box(BlueBall _) -> processBox(b);
+ case Box(GreenBall _) -> stopProcessing();
+ }
+
+ switch (b) {
+ case Box(RedBall _), Box(BlueBall _) -> processBox(b);
+ case Box(GreenBall _) -> stopProcessing();
+ case Box(_) -> pickAnotherBox();
+ }
+
+ int x = 42;
+ switch (b) {
+ // multiple patterns guarded by one guard
+ case Box(RedBall _), Box(BlueBall _) when x == 42 -> processBox(b);
+ case Box(_) -> pickAnotherBox();
+ }
+ }
+
+ private void processBox(Box extends Ball> b) {}
+ private void stopProcessing() {}
+ private void pickAnotherBox() {}
+
+ class Order {}
+ private static final int LIMIT = 10;
+ private int sideEffect() {
+ return 0;
+ }
+
+ void unnamedVariables(List orders) {
+ int total = 0;
+ for (Order _ : orders) {
+ if (total < LIMIT) {
+ total++;
+ }
+ }
+ System.out.println("total: " + total);
+
+ for (int i = 0, _ = sideEffect(); i < 10; i++) {
+ System.out.println(i);
+ }
+
+ Queue q = new ArrayDeque<>(); // x1, y1, z1, x2, y2, z2 ..
+ while (q.size() >= 3) {
+ int x = q.remove();
+ int y = q.remove();
+ int _ = q.remove(); // z is unused
+ Point p = new Point(x, y);
+ }
+ while (q.size() >= 3) {
+ var x = q.remove();
+ var _ = q.remove();
+ var _ = q.remove();
+ Point p = new Point(x, 0);
+ }
+ }
+
+ static class ScopedContext implements AutoCloseable {
+ @Override
+ public void close() { }
+ public static ScopedContext acquire() {
+ return new ScopedContext();
+ }
+ }
+
+ void unusedVariables2() {
+ try (var _ = ScopedContext.acquire()) {
+ //... acquiredContext not used ...
+ }
+
+ String s = "123";
+ try {
+ int i = Integer.parseInt(s);
+ System.out.println(i);
+ } catch (NumberFormatException _) {
+ System.out.println("Bad number: " + s);
+ } catch (Exception _) {
+ System.out.println("error...");
+ }
+
+ List.of("a", "b").stream().collect(Collectors.toMap(String::toUpperCase, _ -> "NO_DATA"));
+ }
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt
new file mode 100644
index 0000000000..ae94a215f0
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt
@@ -0,0 +1,608 @@
++- CompilationUnit[@PackageName = ""]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.ArrayDeque", @ImportedSimpleName = "ArrayDeque", @PackageName = "java.util", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables", @CanonicalName = "Jep456_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep456_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- ClassBody[@Empty = false, @Size = 19]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep456_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]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = true, @Size = 0]
+ +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
+ | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false]
+ | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC]
+ | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
+ | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC]
+ | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
+ | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
+ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 3, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "r"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
+ | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- RecordPattern[]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
+ | | | +- PatternList[@Empty = false, @Size = 2]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- ExpressionStatement[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- IfStatement[@Else = false]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- RecordPattern[]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"]
+ | | +- PatternList[@Empty = false, @Size = 2]
+ | | +- RecordPattern[]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | | +- PatternList[@Empty = false, @Size = 2]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- UnnamedPattern[]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ExpressionStatement[]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{sealed, abstract}", @ExplicitModifiers = "{sealed, abstract}"]
+ | +- PermitsList[@Empty = false, @Size = 3]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
+ | +- ClassBody[@Empty = true, @Size = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep456_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"]
+ | +- ClassBody[@Empty = true, @Size = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep456_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"]
+ | +- ClassBody[@Empty = true, @Size = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep456_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"]
+ | +- ClassBody[@Empty = true, @Size = 0]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep456_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]
+ | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
+ | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "T"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 5, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
+ | | | +- WildcardType[@LowerBound = false, @UpperBound = true]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "b"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | +- SwitchLabel[@Default = false]
+ | | | +- RecordPattern[]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- RecordPattern[]
+ | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
+ | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | +- SwitchLabel[@Default = false]
+ | | | +- RecordPattern[]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | +- UnnamedPattern[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "x"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
+ | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- SwitchArrowBranch[@Default = false]
+ | | +- SwitchLabel[@Default = false]
+ | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- RecordPattern[]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | | +- PatternList[@Empty = false, @Size = 1]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- Guard[]
+ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- SwitchArrowBranch[@Default = false]
+ | +- SwitchLabel[@Default = false]
+ | | +- RecordPattern[]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | +- PatternList[@Empty = false, @Size = 1]
+ | | +- UnnamedPattern[]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ArgumentList[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"]
+ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
+ | | | +- WildcardType[@LowerBound = false, @UpperBound = true]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep456_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 = "{}"]
+ | +- 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]
+ | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ReturnStatement[]
+ | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "List"]
+ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 7, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "total"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- ForeachStatement[]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"]
+ | | | +- VariableDeclarator[@Initializer = false, @Name = "_"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "LIMIT", @Name = "LIMIT", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- ExpressionStatement[]
+ | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ExpressionStatement[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "total: ", @Empty = false, @Image = "\"total: \"", @Length = 7, @LiteralText = "\"total: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "total", @Name = "total", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ForStatement[]
+ | | +- ForInit[]
+ | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "i"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "_"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10]
+ | | +- ForUpdate[]
+ | | | +- StatementExpressionList[@Empty = false, @Size = 1]
+ | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- ExpressionStatement[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"]
+ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "q"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"]
+ | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- WhileStatement[]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
+ | | +- Block[@Empty = false, @Size = 4, @containsComment = false]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "x"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "y"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "_"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "p"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- WhileStatement[]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GE, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "size", @MethodName = "size", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3]
+ | +- Block[@Empty = false, @Size = 4, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "x"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "_"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "_"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "p"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "Point"]
+ | +- ArgumentList[@Empty = false, @Size = 2]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- ImplementsList[@Empty = false, @Size = 1]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"]
+ | +- ClassBody[@Empty = false, @Size = 2]
+ | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true]
+ | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | | | +- Annotation[@SimpleName = "Override"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"]
+ | | +- VoidType[]
+ | | +- FormalParameters[@Empty = true, @Size = 0]
+ | | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ReturnStatement[]
+ | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"]
+ | +- ArgumentList[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 4, @containsComment = false]
+ +- TryStatement[@TryWithResources = true]
+ | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false]
+ | | +- Resource[@ConciseResource = false, @StableName = "_"]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "_"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = true]
+ +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "s"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- TryStatement[@TryWithResources = false]
+ | +- Block[@Empty = false, @Size = 2, @containsComment = false]
+ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableDeclarator[@Initializer = true, @Name = "i"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ExpressionStatement[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- CatchClause[]
+ | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- ExpressionStatement[]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bad number: ", @Empty = false, @Image = "\"Bad number: \"", @Length = 12, @LiteralText = "\"Bad number: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- CatchClause[]
+ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ExpressionStatement[]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "error...", @Empty = false, @Image = "\"error...\"", @Length = 8, @LiteralText = "\"error...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- ExpressionStatement[]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"]
+ | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- ArgumentList[@Empty = true, @Size = 0]
+ +- ArgumentList[@Empty = false, @Size = 1]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"]
+ +- ArgumentList[@Empty = false, @Size = 2]
+ +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false]
+ +- LambdaParameterList[@Empty = false, @Size = 1]
+ | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE]
+ +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java
new file mode 100644
index 0000000000..de3b25ddaf
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.java
@@ -0,0 +1,86 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.Certificate;
+import java.security.interfaces.DSAPublicKey;
+import java.security.interfaces.RSAKey;
+
+/**
+ * @see JEP 447: Statements before super(...) (Preview) (Java 22)
+ */
+class Jep447_StatementsBeforeSuper {
+ // To test backwards compatibility - "normal" explicit constructor invocation
+ public static class Old {
+ public Old() {
+ super();
+ }
+ }
+
+ // Example: Validating superclass constructor arguments
+ public static class PositiveBigInteger extends BigInteger {
+
+ public PositiveBigInteger(long value) {
+ if (value <= 0)
+ throw new IllegalArgumentException("non-positive value");
+ final String valueAsString = String.valueOf(value);
+ super(valueAsString);
+ }
+ }
+
+ // Example: Preparing superclass constructor arguments
+ public static class Super {
+ public Super(byte[] bytes) {}
+ }
+
+ public class Sub extends Super {
+ public Sub(Certificate certificate) {
+ var publicKey = certificate.getPublicKey();
+ if (publicKey == null)
+ throw new IllegalArgumentException("null certificate");
+ final byte[] byteArray = switch (publicKey) {
+ case RSAKey rsaKey -> rsaKey.toString().getBytes(StandardCharsets.UTF_8);
+ case DSAPublicKey dsaKey -> dsaKey.toString().getBytes(StandardCharsets.UTF_8);
+ default -> new byte[0];
+ };
+ super(byteArray);
+ }
+ }
+
+ // Example: Sharing superclass constructor arguments
+ public static class F {}
+ public static class Super2 {
+ public Super2(F f1, F f2) {}
+ }
+ public class Sub2 extends Super2 {
+ public Sub2(int i) {
+ var f = new F();
+ super(f, f);
+ // ... i ...
+ }
+ }
+
+ // Example with records
+ public record Range(int lo, int hi) {
+ public Range(int lo, int hi, int maxDistance) {
+ if (lo > hi)
+ throw new IllegalArgumentException(String.format("(%d,%d)", lo, hi));
+ if (hi - lo > maxDistance)
+ throw new IllegalArgumentException(String.format("(%d,%d,%d", lo, hi, maxDistance));
+ this(lo, hi);
+ }
+ }
+
+ // Example with enum
+ public enum Color {
+ BLUE(1);
+ private Color() {
+ }
+ private Color(int a) {
+ if (a < 0) throw new IllegalArgumentException();
+ this();
+ };
+ }
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt
new file mode 100644
index 0000000000..5d4c451e61
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt
@@ -0,0 +1,283 @@
++- CompilationUnit[@PackageName = ""]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.math.BigInteger", @ImportedSimpleName = "BigInteger", @PackageName = "java.math", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.nio.charset.StandardCharsets", @ImportedSimpleName = "StandardCharsets", @PackageName = "java.nio.charset", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.cert.Certificate", @ImportedSimpleName = "Certificate", @PackageName = "java.security.cert", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.DSAPublicKey", @ImportedSimpleName = "DSAPublicKey", @PackageName = "java.security.interfaces", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.RSAKey", @ImportedSimpleName = "RSAKey", @PackageName = "java.security.interfaces", @Static = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper", @CanonicalName = "Jep447_StatementsBeforeSuper", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep447_StatementsBeforeSuper", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- ClassBody[@Empty = false, @Size = 9]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Old", @CanonicalName = "Jep447_StatementsBeforeSuper.Old", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Old", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Old", @Name = "Old", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false]
+ | +- ArgumentList[@Empty = true, @Size = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$PositiveBigInteger", @CanonicalName = "Jep447_StatementsBeforeSuper.PositiveBigInteger", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PositiveBigInteger", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ExtendsList[@Empty = false, @Size = 1]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "BigInteger"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "PositiveBigInteger", @Name = "PositiveBigInteger", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 3, @containsComment = false]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LE, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | +- ThrowStatement[]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "non-positive value", @Empty = false, @Image = "\"non-positive value\"", @Length = 18, @LiteralText = "\"non-positive value\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "valueOf", @MethodName = "valueOf", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "valueAsString", @Name = "valueAsString", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super", @CanonicalName = "Jep447_StatementsBeforeSuper.Super", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super", @Name = "Super", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE]
+ | | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | | +- ArrayTypeDim[@Varargs = false]
+ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- ExtendsList[@Empty = false, @Size = 1]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Super"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub", @Name = "Sub", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 4, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "publicKey"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "getPublicKey", @MethodName = "getPublicKey", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "certificate", @Name = "certificate", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ThrowStatement[]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null certificate", @Empty = false, @Image = "\"null certificate\"", @Length = 16, @LiteralText = "\"null certificate\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE]
+ | | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | | +- ArrayTypeDim[@Varargs = false]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "byteArray"]
+ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "byteArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "rsaKey", @Name = "rsaKey", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"]
+ | | +- SwitchArrowBranch[@Default = false]
+ | | | +- SwitchLabel[@Default = false]
+ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "dsaKey", @Name = "dsaKey", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"]
+ | | +- SwitchArrowBranch[@Default = true]
+ | | +- SwitchLabel[@Default = true]
+ | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE]
+ | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | +- ArrayDimExpr[@Varargs = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "byteArray", @Name = "byteArray", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$F", @CanonicalName = "Jep447_StatementsBeforeSuper.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ClassBody[@Empty = true, @Size = 0]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super2", @CanonicalName = "Jep447_StatementsBeforeSuper.Super2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Super2", @Name = "Super2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 2]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- ExtendsList[@Empty = false, @Size = 1]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Super2"]
+ | +- ClassBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Sub2", @Name = "Sub2", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = true]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 2, @containsComment = true]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "f"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "F"]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = true, @This = false]
+ | +- ArgumentList[@Empty = false, @Size = 2]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Range", @CanonicalName = "Jep447_StatementsBeforeSuper.Range", @EffectiveVisibility = Visibility.V_PACKAGE, @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]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = false, @Size = 1]
+ | +- ConstructorDeclaration[@Abstract = false, @Arity = 3, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "Range", @Name = "Range", @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"]
+ | +- FormalParameters[@Empty = false, @Size = 3]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 3, @containsComment = false]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ThrowStatement[]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- ArgumentList[@Empty = false, @Size = 3]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d)", @Empty = false, @Image = "\"(%d,%d)\"", @Length = 7, @LiteralText = "\"(%d,%d)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.SUB, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ThrowStatement[]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- ArgumentList[@Empty = false, @Size = 4]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d,%d", @Empty = false, @Image = "\"(%d,%d,%d\"", @Length = 9, @LiteralText = "\"(%d,%d,%d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = false, @This = true]
+ | +- ArgumentList[@Empty = false, @Size = 2]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Color", @CanonicalName = "Jep447_StatementsBeforeSuper.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC]
+ +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"]
+ +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 4, @TrailingComma = false]
+ +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC]
+ | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = true, @Size = 0, @containsComment = false]
+ +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "Color", @Name = "Color", @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false]
+ | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"]
+ | +- FormalParameters[@Empty = false, @Size = 1]
+ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- Block[@Empty = false, @Size = 2, @containsComment = false]
+ | +- IfStatement[@Else = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | +- ThrowStatement[]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true]
+ | +- ArgumentList[@Empty = true, @Size = 0]
+ +- EmptyDeclaration[]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java
new file mode 100644
index 0000000000..1d4cc98254
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.java
@@ -0,0 +1,194 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+import static java.lang.StringTemplate.RAW;
+import static java.util.FormatProcessor.FMT;
+
+import java.io.File;
+import java.time.format.DateTimeFormatter;
+import java.time.LocalTime;
+
+/**
+ * @see JEP 430: String Templates (Preview) (Java 21)
+ * @see JEP 459: String Templates (Second Preview) (Java 22)
+ */
+class Jep459_StringTemplates {
+ record Request(String date, String time, String ipAddress) {}
+
+ static void STRTemplateProcessor() {
+ // Embedded expressions can be strings
+ String firstName = "Bill";
+ String lastName = "Duck";
+ String fullName = STR."\{firstName} \{lastName}";
+ // | "Bill Duck"
+ String sortName = STR."\{lastName}, \{firstName}";
+ // | "Duck, Bill"
+
+ // Embedded expressions can perform arithmetic
+ int x = 10, y = 20;
+ String s1 = STR."\{x} + \{y} = \{x + y}";
+ // | "10 + 20 = 30"
+
+ // Embedded expressions can invoke methods and access fields
+ String s2 = STR."You have a \{getOfferType()} waiting for you!";
+ // | "You have a gift waiting for you!"
+ Request req = new Request("2022-03-25", "15:34", "8.8.8.8");
+ String t = STR."Access at \{req.date} \{req.time} from \{req.ipAddress}";
+ //| "Access at 2022-03-25 15:34 from 8.8.8.8"
+
+ String filePath = "tmp.dat";
+ File file = new File(filePath);
+ String old = "The file " + filePath + " " + (file.exists() ? "does" : "does not") + " exist";
+ String msg = STR."The file \{filePath} \{file.exists() ? "does" : "does not"} exist";
+ // | "The file tmp.dat does exist" or "The file tmp.dat does not exist"
+
+ // spread over multiple lines
+ String time = STR."The time is \{
+ // The java.time.format package is very useful
+ DateTimeFormatter
+ .ofPattern("HH:mm:ss")
+ .format(LocalTime.now())
+ } right now";
+ // | "The time is 12:34:56 right now"
+
+ // Left to right
+ // Embedded expressions can be postfix increment expressions
+ int index = 0;
+ String data = STR."\{index++}, \{index++}, \{index++}, \{index++}";
+ // | "0, 1, 2, 3"
+
+ // Embedded expression is a (nested) template expression
+ String[] fruit = { "apples", "oranges", "peaches" };
+ String s3 = STR."\{fruit[0]}, \{STR."\{fruit[1]}, \{fruit[2]}"}";
+ // | "apples, oranges, peaches"
+ String s4 = STR."\{fruit[0]}, \{
+ STR."\{fruit[1]}, \{fruit[2]}"
+ }";
+ }
+
+ static String getOfferType() { return "_getOfferType_"; }
+
+ static void multilineTemplateExpressions() {
+ String title = "My Web Page";
+ String text = "Hello, world";
+ String html = STR."""
+
+
+ \{title}
+
+
+ \{text}
+
+
+ """;
+ /*
+ | """
+ |
+ |
+ | My Web Page
+ |
+ |
+ | Hello, world
+ |
+ |
+ | """
+ */
+
+ String name = "Joan Smith";
+ String phone = "555-123-4567";
+ String address = "1 Maple Drive, Anytown";
+ String json = STR."""
+ {
+ "name": "\{name}",
+ "phone": "\{phone}",
+ "address": "\{address}"
+ }
+ """;
+ /*
+ | """
+ | {
+ | "name": "Joan Smith",
+ | "phone": "555-123-4567",
+ | "address": "1 Maple Drive, Anytown"
+ | }
+ | """
+ */
+
+ record Rectangle(String name, double width, double height) {
+ double area() {
+ return width * height;
+ }
+ }
+ Rectangle[] zone = new Rectangle[] {
+ new Rectangle("Alfa", 17.8, 31.4),
+ new Rectangle("Bravo", 9.6, 12.4),
+ new Rectangle("Charlie", 7.1, 11.23),
+ };
+ String table = STR."""
+ Description Width Height Area
+ \{zone[0].name} \{zone[0].width} \{zone[0].height} \{zone[0].area()}
+ \{zone[1].name} \{zone[1].width} \{zone[1].height} \{zone[1].area()}
+ \{zone[2].name} \{zone[2].width} \{zone[2].height} \{zone[2].area()}
+ Total \{zone[0].area() + zone[1].area() + zone[2].area()}
+ """;
+ /*
+ | """
+ | Description Width Height Area
+ | Alfa 17.8 31.4 558.92
+ | Bravo 9.6 12.4 119.03999999999999
+ | Charlie 7.1 11.23 79.733
+ | Total 757.693
+ | """
+ */
+ }
+
+ static void FMTTemplateProcessor() {
+ record Rectangle(String name, double width, double height) {
+ double area() {
+ return width * height;
+ }
+ };
+ Rectangle[] zone = new Rectangle[] {
+ new Rectangle("Alfa", 17.8, 31.4),
+ new Rectangle("Bravo", 9.6, 12.4),
+ new Rectangle("Charlie", 7.1, 11.23),
+ };
+ String table = FMT."""
+ Description Width Height Area
+ %-12s\{zone[0].name} %7.2f\{zone[0].width} %7.2f\{zone[0].height} %7.2f\{zone[0].area()}
+ %-12s\{zone[1].name} %7.2f\{zone[1].width} %7.2f\{zone[1].height} %7.2f\{zone[1].area()}
+ %-12s\{zone[2].name} %7.2f\{zone[2].width} %7.2f\{zone[2].height} %7.2f\{zone[2].area()}
+ \{" ".repeat(28)} Total %7.2f\{zone[0].area() + zone[1].area() + zone[2].area()}
+ """;
+ /*
+ | """
+ | Description Width Height Area
+ | Alfa 17.80 31.40 558.92
+ | Bravo 9.60 12.40 119.04
+ | Charlie 7.10 11.23 79.73
+ | Total 757.69
+ | """
+ */
+ }
+
+ static void ensuringSafety() {
+ String name = "Joan";
+ StringTemplate st = RAW."My name is \{name}";
+ String info = STR.process(st);
+ }
+
+ record User(String firstName, int accountNumber) {}
+
+ static void literalsInsideTemplateExpressions() {
+ String s1 = STR."Welcome to your account";
+ // | "Welcome to your account"
+ User user = new User("Lisa", 12345);
+ String s2 = STR."Welcome, \{user.firstName()}, to your account \{user.accountNumber()}";
+ // | "Welcome, Lisa, to your account 12345"
+ }
+
+ static void emptyEmbeddedExpression() {
+ String s1=STR."Test \{ }";
+ }
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt
new file mode 100644
index 0000000000..73aced4fc5
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt
@@ -0,0 +1,707 @@
++- CompilationUnit[@PackageName = ""]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.StringTemplate.RAW", @ImportedSimpleName = "RAW", @PackageName = "java.lang.StringTemplate", @Static = true]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.FormatProcessor.FMT", @ImportedSimpleName = "FMT", @PackageName = "java.util.FormatProcessor", @Static = true]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.io.File", @ImportedSimpleName = "File", @PackageName = "java.io", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.format.DateTimeFormatter", @ImportedSimpleName = "DateTimeFormatter", @PackageName = "java.time.format", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.LocalTime", @ImportedSimpleName = "LocalTime", @PackageName = "java.time", @Static = false]
+ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates", @CanonicalName = "Jep459_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep459_StringTemplates", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- ClassBody[@Empty = false, @Size = 9]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$Request", @CanonicalName = "Jep459_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]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 19, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "x"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "y"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "s1"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} + \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} = \\{"]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "s2"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"You have a \\{"]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "getOfferType", @MethodName = "getOfferType", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- TemplateFragment[@Content = "} waiting for you!\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "req"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"]
+ | | +- ArgumentList[@Empty = false, @Size = 3]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "2022-03-25", @Empty = false, @Image = "\"2022-03-25\"", @Length = 10, @LiteralText = "\"2022-03-25\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "t"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"Access at \\{"]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "date", @Name = "date", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} \\{"]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "time", @Name = "time", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} from \\{"]
+ | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ipAddress", @Name = "ipAddress", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "File"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "file"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "File"]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "old"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The file ", @Empty = false, @Image = "\"The file \"", @Length = 9, @LiteralText = "\"The file \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "msg"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"The file \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} \\{"]
+ | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "file", @Name = "file", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does", @Empty = false, @Image = "\"does\"", @Length = 4, @LiteralText = "\"does\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- TemplateFragment[@Content = "} exist\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "time"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"The time is \\{"]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DateTimeFormatter"]
+ | | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "HH:mm:ss", @Empty = false, @Image = "\"HH:mm:ss\"", @Length = 8, @LiteralText = "\"HH:mm:ss\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "now", @MethodName = "now", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- TemplateFragment[@Content = "} right now\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "index"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "data"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | | +- ArrayTypeDim[@Varargs = false]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"]
+ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "apples", @Empty = false, @Image = "\"apples\"", @Length = 6, @LiteralText = "\"apples\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "s3"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- Template[]
+ | | | +- TemplateFragment[@Content = "\"\\{"]
+ | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | | +- TemplateFragment[@Content = "}, \\{"]
+ | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | | +- TemplateFragment[@Content = "}\""]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "s4"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- Template[]
+ | +- TemplateFragment[@Content = "\"\\{"]
+ | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "}, \\{"]
+ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\\{"]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | +- TemplateFragment[@Content = "}, \\{"]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fruit", @Name = "fruit", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- TemplateFragment[@Content = "}\""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ReturnStatement[]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "_getOfferType_", @Empty = false, @Image = "\"_getOfferType_\"", @Length = 14, @LiteralText = "\"_getOfferType_\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 7, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "title"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "text"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "html"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"\"\"\n \n \n \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "title", @Name = "title", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "} \n \n \n \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}
\n \n \n \"\"\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "name"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "phone"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "address"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "json"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- Template[]
+ | +- TemplateFragment[@Content = "\"\"\"\n {\n \"name\": \"\\{"]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TemplateFragment[@Content = "}\",\n \"phone\": \"\\{"]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "phone", @Name = "phone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TemplateFragment[@Content = "}\",\n \"address\": \"\\{"]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "address", @Name = "address", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TemplateFragment[@Content = "}\"\n }\n \"\"\";\n /*\n | \"\"\"\n | {\n | \"name\": \"Joan Smith\",\n | \"phone\": \"555-123-4567\",\n | \"address\": \"1 Maple Drive, Anytown\"\n | }\n | \"\"\"\n */\n\n record Rectangle(String name, double width, double height) {\n double area() {\n return width * height;\n }\n }\n Rectangle[] zone = new Rectangle[] {\n new Rectangle(\"Alfa\", 17.8, 31.4),\n new Rectangle(\"Bravo\", 9.6, 12.4),\n new Rectangle(\"Charlie\", 7.1, 11.23),\n };\n String table = STR.\"\"\"\n Description Width Height Area\n \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n Total \\{"]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n \"\"\""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 4, @containsComment = false]
+ | +- LocalClassStatement[]
+ | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
+ | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false]
+ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE]
+ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordBody[@Empty = false, @Size = 1]
+ | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE]
+ | | +- FormalParameters[@Empty = true, @Size = 0]
+ | | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | | +- ReturnStatement[]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- EmptyStatement[]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
+ | | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | | +- ArrayTypeDim[@Varargs = false]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "zone"]
+ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayType[@ArrayDepth = 1]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
+ | | | +- ArrayDimensions[@Empty = false, @Size = 1]
+ | | | +- ArrayTypeDim[@Varargs = false]
+ | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
+ | | | +- ArgumentList[@Empty = false, @Size = 3]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
+ | | | +- ArgumentList[@Empty = false, @Size = 3]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"]
+ | | +- ArgumentList[@Empty = false, @Size = 3]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "table"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- Template[]
+ | +- TemplateFragment[@Content = "\"\"\"\n Description Width Height Area\n %-12s\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n %-12s\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n %-12s\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | +- TemplateFragment[@Content = "} %7.2f\\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "repeat", @MethodName = "repeat", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- ArgumentList[@Empty = false, @Size = 1]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "28", @IntLiteral = true, @Integral = true, @LiteralText = "28", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 28.0, @ValueAsFloat = 28.0, @ValueAsInt = 28, @ValueAsLong = 28]
+ | +- TemplateFragment[@Content = "} Total %7.2f\\{"]
+ | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0]
+ | | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1]
+ | | | +- ArgumentList[@Empty = true, @Size = 0]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "area", @MethodName = "area", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArrayAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zone", @Name = "zone", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\n \"\"\""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 3, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "name"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "st"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- Template[]
+ | | +- TemplateFragment[@Content = "\"My name is \\{"]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- TemplateFragment[@Content = "}\""]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "info"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- AmbiguousName[@CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$User", @CanonicalName = "Jep459_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"]
+ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE]
+ | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"]
+ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE]
+ | +- RecordBody[@Empty = true, @Size = 0]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ | +- VoidType[]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 3, @containsComment = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "s1"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Welcome to your account", @Empty = false, @Image = "\"Welcome to your account\"", @Length = 23, @LiteralText = "\"Welcome to your account\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "User"]
+ | | +- VariableDeclarator[@Initializer = true, @Name = "user"]
+ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "User"]
+ | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345]
+ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "s2"]
+ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- Template[]
+ | +- TemplateFragment[@Content = "\"Welcome, \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "firstName", @MethodName = "firstName", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}, to your account \\{"]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "accountNumber", @MethodName = "accountNumber", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "user", @Name = "user", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- TemplateFragment[@Content = "}\""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ +- VariableDeclarator[@Initializer = true, @Name = "s1"]
+ +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL]
+ +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true]
+ +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- Template[]
+ +- TemplateFragment[@Content = "\"Test \\{"]
+ +- TemplateFragment[@Content = "}\""]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java
new file mode 100644
index 0000000000..fc1cea6d7c
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.java
@@ -0,0 +1,14 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+
+
+/**
+ * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21)
+ * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22)
+ */
+
+void main() {
+ System.out.println("Hello World");
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt
new file mode 100644
index 0000000000..8bafb59ab5
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt
@@ -0,0 +1,13 @@
++- CompilationUnit[@PackageName = ""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ +- ExpressionStatement[]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ +- ArgumentList[@Empty = false, @Size = 1]
+ +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello World", @Empty = false, @Image = "\"Hello World\"", @Length = 11, @LiteralText = "\"Hello World\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java
new file mode 100644
index 0000000000..1e2d223c24
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.java
@@ -0,0 +1,16 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+
+
+/**
+ * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21)
+ * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22)
+ */
+
+String greeting() { return "Hello, World!"; }
+
+void main() {
+ System.out.println(greeting());
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt
new file mode 100644
index 0000000000..200582f309
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt
@@ -0,0 +1,21 @@
++- CompilationUnit[@PackageName = ""]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- FormalParameters[@Empty = true, @Size = 0]
+ | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ | +- ReturnStatement[]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ +- ExpressionStatement[]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ +- ArgumentList[@Empty = false, @Size = 1]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- ArgumentList[@Empty = true, @Size = 0]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java
new file mode 100644
index 0000000000..3cbde1d0e5
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.java
@@ -0,0 +1,16 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+
+
+/**
+ * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21)
+ * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22)
+ */
+
+String greeting = "Hello, World!";
+
+void main() {
+ System.out.println(greeting);
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt
new file mode 100644
index 0000000000..2c78364825
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt
@@ -0,0 +1,19 @@
++- CompilationUnit[@PackageName = ""]
+ +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "greeting"]
+ | +- 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 = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ +- ExpressionStatement[]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ +- ArgumentList[@Empty = false, @Size = 1]
+ +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java
new file mode 100644
index 0000000000..b22ef710d0
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.java
@@ -0,0 +1,17 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+/**
+ * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21)
+ * @see JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) (Java 22)
+ */
+
+String greeting = Arrays.asList("Hello", "World!").stream().collect(Collectors.joining(", "));
+
+void main() {
+ System.out.println(greeting);
+}
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt
new file mode 100644
index 0000000000..ab0ba4f8de
--- /dev/null
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt
@@ -0,0 +1,35 @@
++- CompilationUnit[@PackageName = ""]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Arrays", @ImportedSimpleName = "Arrays", @PackageName = "java.util", @Static = false]
+ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false]
+ +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE]
+ | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "String"]
+ | +- VariableDeclarator[@Initializer = true, @Name = "greeting"]
+ | +- 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 = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- MethodCall[@CompileTimeConstant = false, @Image = "asList", @MethodName = "asList", @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Arrays"]
+ | | | +- ArgumentList[@Empty = false, @Size = 2]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello", @Empty = false, @Image = "\"Hello\"", @Length = 5, @LiteralText = "\"Hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "World!", @Empty = false, @Image = "\"World!\"", @Length = 6, @LiteralText = "\"World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ | | +- ArgumentList[@Empty = true, @Size = 0]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- MethodCall[@CompileTimeConstant = false, @Image = "joining", @MethodName = "joining", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"]
+ | +- ArgumentList[@Empty = false, @Size = 1]
+ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+ +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+ +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"]
+ +- VoidType[]
+ +- FormalParameters[@Empty = true, @Size = 0]
+ +- Block[@Empty = false, @Size = 1, @containsComment = false]
+ +- ExpressionStatement[]
+ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+ +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
+ | +- ClassType[@FullyQualified = false, @SimpleName = "System"]
+ +- ArgumentList[@Empty = false, @Size = 1]
+ +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false]
diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml
index b8328ba236..6f4158572f 100755
--- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml
+++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/documentation/xml/CommentRequired.xml
@@ -514,17 +514,7 @@ public class CommentRequired {
- #1683 [java] CommentRequired property names are inconsistent - use deprecated property
- Unwanted
- 1
-
-
-
-
- #1683 [java] CommentRequired property names are inconsistent - use new property
+ #1683 [java] CommentRequired property names are inconsistent
Unwanted
1
+
+
+ [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 1
+ 0
+
+
+
+
+ [java] SingletonClassReturningNewInstance false positive with double assignment #932 - variant 2
+ 0
+
+
diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml
index 1fb4bb9ea9..39cd2edf07 100644
--- a/pmd-javascript/pom.xml
+++ b/pmd-javascript/pom.xml
@@ -49,7 +49,7 @@
-
+
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java
index de8217aae9..c835b51951 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/LanguageVersionTest.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.ecmascript;
import java.util.Arrays;
import java.util.Collection;
-import net.sourceforge.pmd.AbstractLanguageVersionTest;
+import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
class LanguageVersionTest extends AbstractLanguageVersionTest {
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java
similarity index 75%
rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java
rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java
index 79bc52e1f5..c77cdb9cce 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ant/PMDTaskTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/PMDTaskTest.java
@@ -2,13 +2,16 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd.ant;
+package net.sourceforge.pmd.lang.ecmascript;
import org.junit.jupiter.api.Test;
+import net.sourceforge.pmd.test.AbstractAntTestHelper;
+
class PMDTaskTest extends AbstractAntTestHelper {
PMDTaskTest() {
+ super.pathToTestScript = "target/test-classes/net/sourceforge/pmd/lang/ecmascript/ant/xml";
super.antTestScriptFilename = "pmdtasktest.xml";
}
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java
similarity index 85%
rename from pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java
rename to pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java
index 292986f722..be7fc68b18 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/ReportTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ReportTest.java
@@ -2,10 +2,10 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.ecmascript;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSize;
-import static net.sourceforge.pmd.lang.ast.test.TestUtilsKt.assertSuppressed;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSize;
+import static net.sourceforge.pmd.lang.test.ast.TestUtilsKt.assertSuppressed;
import org.junit.jupiter.api.Test;
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java
index 32b1211d9d..61cfb5bfc0 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/RuleSetFactoryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript;
-import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
+import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
/**
* Test javascript's rulesets
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java
index 0c0f2520fd..5fbc2a573d 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsParsingHelper.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.ast;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
public final class JsParsingHelper extends BaseParsingHelper {
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java
index cdff450c60..1420aeea59 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/ast/JsTreeDumpTest.java
@@ -7,9 +7,9 @@ package net.sourceforge.pmd.lang.ecmascript.ast;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
-import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest;
-import net.sourceforge.pmd.lang.ast.test.NodePrintersKt;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseTreeDumpTest;
+import net.sourceforge.pmd.lang.test.ast.NodePrintersKt;
class JsTreeDumpTest extends BaseTreeDumpTest {
JsTreeDumpTest() {
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java
index c159efd6e9..b7d8f05d88 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/AnyCpdLexerForTypescriptTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
/**
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java
index 16b176bf43..35d420cdb3 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/cpd/EcmascriptCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.ecmascript.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule;
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java
index 5d308cf576..be636f6ca7 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/AvoidWithStatementTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidWithStatementTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java
index 65afa849ce..0d2066ec8b 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ConsistentReturnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java
index 0645d97bd6..e949d1e498 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/GlobalVariableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class GlobalVariableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java
index 03052f13ed..390b61c5f0 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ScopeForInVariableTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ScopeForInVariableTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java
index c3dc0e1f8a..b6aab8d246 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/UseBaseWithParseIntTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.bestpractices;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UseBaseWithParseIntTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java
index 09d7db44c8..8d83dfa58c 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/AssignmentInOperandTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AssignmentInOperandTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java
index 1ad9afc710..c992b704b9 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/ForLoopsMustUseBracesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class ForLoopsMustUseBracesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java
index b122d7a4b6..d2afcf84f1 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfElseStmtsMustUseBracesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class IfElseStmtsMustUseBracesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java
index 0d8595570d..e5d996f654 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/IfStmtsMustUseBracesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class IfStmtsMustUseBracesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java
index 92b91cd7d7..abbe38ecbb 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/NoElseReturnTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class NoElseReturnTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java
index 53c6ceb9c4..97390b04c5 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryBlockTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryBlockTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java
index c94b0b9e40..b50f4927af 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnnecessaryParenthesesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnnecessaryParenthesesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java
index e60cb484c9..438e03aa2f 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/UnreachableCodeTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class UnreachableCodeTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java
index d681626c2c..4878c6aac6 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/codestyle/WhileLoopsMustUseBracesTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class WhileLoopsMustUseBracesTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java
index d865674576..2406d43308 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/AvoidTrailingCommaTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class AvoidTrailingCommaTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java
index 86e1b9defc..b794703157 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/EqualComparisonTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class EqualComparisonTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java
index 4cdd66abbd..73cbf9e509 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/ecmascript/rule/errorprone/InnaccurateNumericLiteralTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.ecmascript.rule.errorprone;
-import net.sourceforge.pmd.testframework.PmdRuleTst;
+import net.sourceforge.pmd.test.PmdRuleTst;
class InnaccurateNumericLiteralTest extends PmdRuleTst {
// no additional unit tests
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java
index aa2d7f84df..f37676926e 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/lang/typescript/cpd/TypeScriptCpdLexerTest.java
@@ -6,7 +6,7 @@ package net.sourceforge.pmd.lang.typescript.cpd;
import org.junit.jupiter.api.Test;
-import net.sourceforge.pmd.cpd.test.CpdTextComparisonTest;
+import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
import net.sourceforge.pmd.lang.typescript.TsLanguageModule;
class TypeScriptCpdLexerTest extends CpdTextComparisonTest {
diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js b/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js
deleted file mode 100644
index 2b5c200d55..0000000000
--- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/cli/ExampleFile.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-// just some js file for net.sourceforge.pmd.cli.CLITest
diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml
similarity index 91%
rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml
rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml
index 529d3cb514..c01e130009 100644
--- a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml
+++ b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/pmdtasktest.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml b/pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml
similarity index 100%
rename from pmd-javascript/src/test/resources/net/sourceforge/pmd/ant/xml/ruleset.xml
rename to pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/ecmascript/ant/xml/ruleset.xml
diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml
index 42bb314996..357e96396c 100644
--- a/pmd-jsp/pom.xml
+++ b/pmd-jsp/pom.xml
@@ -42,7 +42,7 @@
-
+
diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java
similarity index 97%
rename from pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java
rename to pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java
index 4f2e0a60bb..ceb1147568 100644
--- a/pmd-jsp/src/test/java/net/sourceforge/pmd/LanguageVersionDiscovererTest.java
+++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionDiscovererTest.java
@@ -2,7 +2,7 @@
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
-package net.sourceforge.pmd;
+package net.sourceforge.pmd.lang.jsp;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java
index eb2eb31267..303be4dbd6 100644
--- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java
+++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/LanguageVersionTest.java
@@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.jsp;
import java.util.Arrays;
import java.util.Collection;
-import net.sourceforge.pmd.AbstractLanguageVersionTest;
+import net.sourceforge.pmd.test.AbstractLanguageVersionTest;
class LanguageVersionTest extends AbstractLanguageVersionTest {
diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java
index 531bde227b..e9e19c024c 100644
--- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java
+++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/RuleSetFactoryTest.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.jsp;
-import net.sourceforge.pmd.lang.rule.AbstractRuleSetFactoryTest;
+import net.sourceforge.pmd.test.lang.rule.AbstractRuleSetFactoryTest;
/**
* Test jsp's rulesets
diff --git a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java
index 3cfed74953..83f7c1b6c9 100644
--- a/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java
+++ b/pmd-jsp/src/test/java/net/sourceforge/pmd/lang/jsp/ast/JspParsingHelper.java
@@ -4,7 +4,7 @@
package net.sourceforge.pmd.lang.jsp.ast;
-import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper;
+import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper;
import net.sourceforge.pmd.lang.jsp.JspLanguageModule;
public final class JspParsingHelper extends BaseParsingHelper