From 4f947b46e04b6ebce778fbd36cbbc8f95fec314b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 25 Jan 2023 19:19:10 -0300 Subject: [PATCH 01/70] [core] Fix the cache - The cache listener was broken, and violations never actually made it to the cache --- .../sourceforge/pmd/cache/AbstractAnalysisCache.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java index 74af13c400..9a4dd6887a 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java @@ -211,19 +211,12 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { @Override public FileAnalysisListener startFileAnalysis(TextDocument file) { - String fileName = file.getPathId(); - AnalysisResult analysisResult = updatedResultsCache.get(fileName); - if (analysisResult == null) { - analysisResult = new AnalysisResult(file.getCheckSum()); - } - final AnalysisResult nonNullAnalysisResult = analysisResult; + final String fileName = file.getPathId(); return new FileAnalysisListener() { @Override public void onRuleViolation(RuleViolation violation) { - synchronized (nonNullAnalysisResult) { - nonNullAnalysisResult.addViolation(violation); - } + updatedResultsCache.get(fileName).addViolation(violation); } @Override From 7a61c431d7aadee5b4f1a37c67a84199bd493065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Wed, 25 Jan 2023 19:27:23 -0300 Subject: [PATCH 02/70] Update test to reflect the actual invocation order - This reproduces the issue without the fix --- .../net/sourceforge/pmd/cache/FileAnalysisCacheTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java index d6b231df6b..4db735cbea 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java @@ -43,6 +43,7 @@ import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.document.TextFileContent; import net.sourceforge.pmd.lang.document.TextRange2d; +import net.sourceforge.pmd.reporting.FileAnalysisListener; class FileAnalysisCacheTest { @@ -111,6 +112,8 @@ class FileAnalysisCacheTest { void testStorePersistsFilesWithViolations() throws IOException { final FileAnalysisCache cache = new FileAnalysisCache(newCacheFile); cache.checkValidity(mock(RuleSets.class), mock(ClassLoader.class)); + final FileAnalysisListener cacheListener = cache.startFileAnalysis(sourceFile); + cache.isUpToDate(sourceFile); final RuleViolation rv = mock(RuleViolation.class); @@ -120,7 +123,7 @@ class FileAnalysisCacheTest { when(rule.getLanguage()).thenReturn(mock(Language.class)); when(rv.getRule()).thenReturn(rule); - cache.startFileAnalysis(sourceFile).onRuleViolation(rv); + cacheListener.onRuleViolation(rv); cache.persist(); final FileAnalysisCache reloadedCache = new FileAnalysisCache(newCacheFile); From 49cd0b3e163e687ff652fa95d15041489488247b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 26 Jan 2023 02:19:35 -0300 Subject: [PATCH 03/70] [core] Allow more XPath rules to use the rulechain - When a rule uses a property Saxon produces a top-level LetExpression - Since LetExpressions can also be used to "cache" expensive operations during rule evaluation we generally ignored them, but we don't anymore. - If a LetExpression was for an expensive operation, we still refrain from using the rulechain so it's only evaluated once --- .../internal/SaxonExprTransformations.java | 38 ++++++++++++++++++- .../xpath/internal/SaxonXPathRuleQuery.java | 1 + .../lang/rule/xpath/internal/SplitUnions.java | 5 ++- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java index 4bbcafa843..62ff9e304b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java @@ -10,6 +10,7 @@ import java.util.Collections; import net.sf.saxon.expr.AxisExpression; import net.sf.saxon.expr.Expression; import net.sf.saxon.expr.FilterExpression; +import net.sf.saxon.expr.LetExpression; import net.sf.saxon.expr.RootExpression; import net.sf.saxon.expr.SlashExpression; import net.sf.saxon.om.AxisInfo; @@ -99,9 +100,42 @@ final class SaxonExprTransformations { unions.visit(expr); if (unions.getExpressions().isEmpty()) { return Collections.singletonList(expr); - } else { - return unions.getExpressions(); } + return unions.getExpressions(); } + static Expression copyTopLevelLets(Expression modified, Expression original) { + // Does it need them? + if (modified instanceof LetExpression) { + return modified; + } + + final SaxonExprVisitor topLevelLetCopier = new SaxonExprVisitor() { + + @Override + public Expression visit(LetExpression e) { + // keep copying + if (e.getAction() instanceof LetExpression) { + return super.visit(e); + } + + // Manually craft the inner-most LetExpression + Expression action = visit(modified); + Expression sequence = visit(e.getSequence()); + LetExpression result = new LetExpression(); + result.setAction(action); + result.setSequence(sequence); + result.setVariableQName(e.getVariableQName()); + result.setRequiredType(e.getRequiredType()); + result.setSlotNumber(e.getLocalSlotNumber()); + return result; + } + }; + + if (original instanceof LetExpression) { + return topLevelLetCopier.visit(original); + } + + return modified; + } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java index b2bfbadd2d..70ec7b7e59 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java @@ -226,6 +226,7 @@ public class SaxonXPathRuleQuery { Expression modified = subexpression; modified = SaxonExprTransformations.hoistFilters(modified); modified = SaxonExprTransformations.reduceRoot(modified); + modified = SaxonExprTransformations.copyTopLevelLets(modified, expr); RuleChainAnalyzer rca = new RuleChainAnalyzer(xpathEvaluator.getConfiguration()); final Expression finalExpr = rca.visit(modified); // final because of lambda diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SplitUnions.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SplitUnions.java index 3d70db5d19..592049b3f5 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SplitUnions.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SplitUnions.java @@ -11,6 +11,7 @@ import java.util.ArrayList; import java.util.List; import net.sf.saxon.expr.Expression; +import net.sf.saxon.expr.LetExpression; import net.sf.saxon.expr.VennExpression; import net.sf.saxon.expr.parser.Token; import net.sf.saxon.expr.sort.DocumentSorter; @@ -40,8 +41,8 @@ class SplitUnions extends SaxonExprVisitor { @Override public Expression visit(Expression e) { - // only flatten toplevel unions - if (e instanceof VennExpression || e instanceof DocumentSorter) { + // only flatten top level unions - skip sorters and let around it + if (e instanceof VennExpression || e instanceof DocumentSorter || e instanceof LetExpression) { return super.visit(e); } else { return e; From 1102f936c879be09775046fcaa35407e4355a8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 26 Jan 2023 02:53:48 -0300 Subject: [PATCH 04/70] Add test case --- .../rule/xpath/internal/SaxonXPathRuleQueryTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQueryTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQueryTest.java index 8b616459f6..0ac4753eaa 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQueryTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQueryTest.java @@ -373,6 +373,16 @@ class SaxonXPathRuleQueryTest { assertExpression(expectedSubexpression, query.nodeNameToXPaths.get("DoStatement").get(0)); } + @Test + void ruleChainVisitsWithUnionsAndLets() { + PropertyDescriptor boolProperty = PropertyFactory.booleanProperty("checkAll").desc("test").defaultValue(true).build(); + SaxonXPathRuleQuery query = createQuery("//dummyNode[$checkAll and ClassOrInterfaceType] | //ForStatement[not($checkAll)]", boolProperty); + List ruleChainVisits = query.getRuleChainVisits(); + assertEquals(2, ruleChainVisits.size()); + assertTrue(ruleChainVisits.contains("dummyNode")); + assertTrue(ruleChainVisits.contains("ForStatement")); + } + private static void assertExpression(String expected, Expression actual) { assertEquals(normalizeExprDump(expected), normalizeExprDump(actual.toString())); From bdbbcac37d2239d10f403f6d783b6a1da1d40d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 27 Jan 2023 23:10:57 -0300 Subject: [PATCH 05/70] Add checks for the cached values --- .../net/sourceforge/pmd/cache/FileAnalysisCacheTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java index 4db735cbea..2a520a8e05 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java @@ -118,7 +118,8 @@ class FileAnalysisCacheTest { final RuleViolation rv = mock(RuleViolation.class); when(rv.getFilename()).thenReturn(sourceFile.getDisplayName()); - when(rv.getLocation()).thenReturn(FileLocation.range(sourceFile.getDisplayName(), TextRange2d.range2d(1, 2, 3, 4))); + final TextRange2d textLocation = TextRange2d.range2d(1, 2, 3, 4); + when(rv.getLocation()).thenReturn(FileLocation.range(sourceFile.getDisplayName(), textLocation)); final net.sourceforge.pmd.Rule rule = mock(net.sourceforge.pmd.Rule.class, Mockito.RETURNS_SMART_NULLS); when(rule.getLanguage()).thenReturn(mock(Language.class)); when(rv.getRule()).thenReturn(rule); @@ -133,6 +134,12 @@ class FileAnalysisCacheTest { final List cachedViolations = reloadedCache.getCachedViolations(sourceFile); assertEquals(1, cachedViolations.size(), "Cached rule violations count mismatch"); + final RuleViolation cachedViolation = cachedViolations.get(0); + assertEquals(sourceFile.getDisplayName(), cachedViolation.getFilename()); + assertEquals(textLocation.getStartLine(), cachedViolation.getBeginLine()); + assertEquals(textLocation.getStartColumn(), cachedViolation.getBeginColumn()); + assertEquals(textLocation.getEndLine(), cachedViolation.getEndLine()); + assertEquals(textLocation.getEndColumn(), cachedViolation.getEndColumn()); } @Test From e1cb727048cb82eb168508b2cbb1113fdb7261d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 27 Jan 2023 23:11:42 -0300 Subject: [PATCH 06/70] Fix rule violation location storage --- .../java/net/sourceforge/pmd/cache/CachedRuleViolation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java index 40e81a97f7..6c7c735b10 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java @@ -129,7 +129,7 @@ public final class CachedRuleViolation implements RuleViolation { FileLocation location = violation.getLocation(); stream.writeInt(location.getStartPos().getLine()); stream.writeInt(location.getStartPos().getColumn()); - stream.writeInt(location.getEndPos().getColumn()); + stream.writeInt(location.getEndPos().getLine()); stream.writeInt(location.getEndPos().getColumn()); Map additionalInfo = violation.getAdditionalInfo(); stream.writeInt(additionalInfo.size()); From a46629054a3bbaf799eb71b02c8efb38e42a47db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 27 Jan 2023 23:12:14 -0300 Subject: [PATCH 07/70] Properly restore file names from violations - The change to pathid adds proper support for zips and avoids conflicts, and allows cache hits even when using absolute / relativized paths. - However, the restored rules where using the pathid as a displayname, which was never accurate. - Furthermore, the new implementation allows to honor relativized paths in the current run, being different to the original one that created the cache --- .../net/sourceforge/pmd/cache/AbstractAnalysisCache.java | 7 +++++++ .../net/sourceforge/pmd/cache/CachedRuleViolation.java | 8 +++++++- .../java/net/sourceforge/pmd/cache/FileAnalysisCache.java | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java index 9a4dd6887a..5691870312 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java @@ -79,6 +79,13 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { if (result) { LOG.debug("Incremental Analysis cache HIT"); + + /* + * Update cached violation "filename" to match the appropriate text document, + * so we can honor relativized paths for the current run + */ + final String displayName = document.getDisplayName(); + analysisResult.getViolations().forEach(v -> ((CachedRuleViolation) v).setFileDisplayName(displayName)); } else { LOG.debug("Incremental Analysis cache MISS - {}", analysisResult != null ? "file changed" : "no previous result found"); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java index 6c7c735b10..4bc38ecbeb 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java @@ -33,12 +33,13 @@ public final class CachedRuleViolation implements RuleViolation { private final CachedRuleMapper mapper; private final String description; - private final FileLocation location; private final String ruleClassName; private final String ruleName; private final String ruleTargetLanguage; private final Map additionalInfo; + private FileLocation location; + private CachedRuleViolation(final CachedRuleMapper mapper, final String description, final String fileName, final String ruleClassName, final String ruleName, final String ruleTargetLanguage, final int beginLine, final int beginColumn, @@ -52,6 +53,11 @@ public final class CachedRuleViolation implements RuleViolation { this.ruleTargetLanguage = ruleTargetLanguage; this.additionalInfo = additionalInfo; } + + public void setFileDisplayName(String displayName) { + this.location = FileLocation.range(displayName, + TextRange2d.range2d(getBeginLine(), getBeginColumn(), getEndLine(), getEndColumn())); + } @Override public Rule getRule() { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java index d2739cfc92..6f61898d9d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java @@ -132,7 +132,7 @@ public class FileAnalysisCache extends AbstractAnalysisCache { for (final Map.Entry resultEntry : updatedResultsCache.entrySet()) { final List violations = resultEntry.getValue().getViolations(); - outputStream.writeUTF(resultEntry.getKey()); // the full filename + outputStream.writeUTF(resultEntry.getKey()); // the path id outputStream.writeLong(resultEntry.getValue().getFileChecksum()); outputStream.writeInt(violations.size()); From 9e9437cdff800bf612ddb6fd6c651121d2f83783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 27 Jan 2023 23:47:04 -0300 Subject: [PATCH 08/70] Add missing test cases for zip fingerprinting --- .../internal/ZipFileFingerprinterTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/ZipFileFingerprinterTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/ZipFileFingerprinterTest.java index 62017b3be3..f9a829b17d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/ZipFileFingerprinterTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/internal/ZipFileFingerprinterTest.java @@ -40,6 +40,32 @@ class ZipFileFingerprinterTest extends AbstractClasspathEntryFingerprinterTest { assertEquals(baselineFingerprint, updateFingerprint(file)); assertNotEquals(originalFileSize, file.length()); } + + @Test + void zipEntryOrderDoesNotAffectFingerprint() throws IOException { + final File zipFile = tempDir.resolve("foo.jar").toFile(); + final ZipEntry fooEntry = new ZipEntry("lib/Foo.class"); + final ZipEntry barEntry = new ZipEntry("lib/Bar.class"); + overwriteZipFileContents(zipFile, fooEntry, barEntry); + final long baselineFingerprint = getBaseLineFingerprint(zipFile); + + // swap order + overwriteZipFileContents(zipFile, barEntry, fooEntry); + assertEquals(baselineFingerprint, updateFingerprint(zipFile)); + } + + @Test + void nonClassZipEntryDoesNotAffectFingerprint() throws IOException { + final File zipFile = tempDir.resolve("foo.jar").toFile(); + final ZipEntry fooEntry = new ZipEntry("lib/Foo.class"); + final ZipEntry barEntry = new ZipEntry("bar.properties"); + overwriteZipFileContents(zipFile, fooEntry); + final long baselineFingerprint = getBaseLineFingerprint(zipFile); + + // add a properties file to the jar + overwriteZipFileContents(zipFile, fooEntry, barEntry); + assertEquals(baselineFingerprint, updateFingerprint(zipFile)); + } @Override protected ClasspathEntryFingerprinter newFingerPrinter() { From 4eaae9ab4ed3f596c3118e69668a6a3a77ff4f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:12:22 -0300 Subject: [PATCH 09/70] Simplify rule applicability check - We only need to do it once per AST - If it fails, there is no need to even try and apply it --- .../pmd/lang/rule/internal/RuleApplicator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java index e867253eb7..08bc1fc15b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/internal/RuleApplicator.java @@ -20,6 +20,7 @@ import net.sourceforge.pmd.benchmark.TimedOperation; import net.sourceforge.pmd.benchmark.TimedOperationCategory; import net.sourceforge.pmd.internal.SystemProps; import net.sourceforge.pmd.internal.util.AssertionUtil; +import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.ast.RootNode; import net.sourceforge.pmd.reporting.FileAnalysisListener; @@ -37,6 +38,7 @@ public class RuleApplicator { // to eg type resolution. private final TreeIndex idx; + private LanguageVersion currentLangVer; public RuleApplicator(TreeIndex index) { this.idx = index; @@ -46,6 +48,7 @@ public class RuleApplicator { public void index(RootNode root) { idx.reset(); indexTree(root, idx); + currentLangVer = root.getLanguageVersion(); } public void apply(Collection rules, FileAnalysisListener listener) { @@ -54,6 +57,10 @@ public class RuleApplicator { private void applyOnIndex(TreeIndex idx, Collection rules, FileAnalysisListener listener) { for (Rule rule : rules) { + if (!RuleSet.applies(rule, currentLangVer)) { + continue; // No point in even trying to apply the rule + } + RuleContext ctx = RuleContext.create(listener, rule); rule.start(ctx); try { @@ -61,9 +68,6 @@ public class RuleApplicator { Iterator targets = rule.getTargetSelector().getVisitedNodes(idx); while (targets.hasNext()) { Node node = targets.next(); - if (!RuleSet.applies(rule, node.getTextDocument().getLanguageVersion())) { - continue; - } try (TimedOperation rcto = TimeTracker.startOperation(TimedOperationCategory.RULE, rule.getName())) { rule.apply(node, ctx); From bbd898549ebaa825b864d494f0656cc69c05c426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:13:30 -0300 Subject: [PATCH 10/70] Remove dead container - The values were stored but never read --- .../java/rule/codestyle/UnnecessaryImportRule.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportRule.java index 8858928be3..cef8eea7c5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryImportRule.java @@ -58,10 +58,8 @@ public class UnnecessaryImportRule extends AbstractJavaRule { private static final String IMPORT_FROM_SAME_PACKAGE_MESSAGE = "Unnecessary import from the current package ''{0}''"; private static final String IMPORT_FROM_JAVA_LANG_MESSAGE = "Unnecessary import from the java.lang package ''{0}''"; - private final Set staticImports = new HashSet<>(); private final Set allSingleNameImports = new HashSet<>(); private final Set allImportsOnDemand = new HashSet<>(); - private final Set staticImportsOnDemand = new HashSet<>(); private final Set unnecessaryJavaLangImports = new HashSet<>(); private final Set unnecessaryImportsFromSamePackage = new HashSet<>(); @@ -101,8 +99,6 @@ public class UnnecessaryImportRule extends AbstractJavaRule { @Override public Object visit(ASTCompilationUnit node, Object data) { this.allSingleNameImports.clear(); - this.staticImports.clear(); - this.staticImportsOnDemand.clear(); this.allImportsOnDemand.clear(); this.unnecessaryJavaLangImports.clear(); this.unnecessaryImportsFromSamePackage.clear(); @@ -214,12 +210,6 @@ public class UnnecessaryImportRule extends AbstractJavaRule { // duplicate reportWithMessage(node, data, DUPLICATE_IMPORT_MESSAGE); } - - if (node.isStatic()) { - container = node.isImportOnDemand() ? staticImportsOnDemand - : staticImports; - container.add(new ImportWrapper(node)); - } } private void reportWithMessage(ASTImportDeclaration node, Object data, String message) { From 648d4e9a24486c405b9f16507b28fb31f172f614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:13:59 -0300 Subject: [PATCH 11/70] Avoid re-parsing the method signature --- .../pmd/lang/java/rule/errorprone/CloseResourceRule.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java index 2f39b9ccb1..c4c783d179 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/errorprone/CloseResourceRule.java @@ -105,6 +105,8 @@ public class CloseResourceRule extends AbstractJavaRule { booleanProperty("closeNotInFinally") .desc("Detect if 'close' (or other closeTargets) is called outside of a finally-block").defaultValue(false).build(); + private static final InvocationMatcher OBJECTS_NON_NULL = InvocationMatcher.parse("java.util.Objects#nonNull(_)"); + private final Set types = new HashSet<>(); private final Set simpleTypes = new HashSet<>(); private final Set closeTargets = new HashSet<>(); @@ -573,8 +575,7 @@ public class CloseResourceRule extends AbstractJavaRule { } private boolean isObjectsNonNull(ASTExpression expression, ASTVariableDeclaratorId var) { - InvocationMatcher matcher = InvocationMatcher.parse("java.util.Objects#nonNull(_)"); - if (matcher.matchesCall(expression)) { + if (OBJECTS_NON_NULL.matchesCall(expression)) { ASTMethodCall methodCall = (ASTMethodCall) expression; return JavaAstUtils.isReferenceToVar(methodCall.getArguments().get(0), var.getSymbol()); } From c93f4cad9b87d7987b65daaa023c56b31223cae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:15:18 -0300 Subject: [PATCH 12/70] Revamp MissingStaticMethodInNonInstantiatableClass - Somewhat simplify the XPath - Make it more robust: - private static methods are not ok - Check actual return statement types rather than the method signature, as inheritance may muddy the waters - We don't need the methods from the nested class to be public, just not private - Same applies to the nested class itself --- .../resources/category/java/errorprone.xml | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 326207ef35..b6889d8454 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2351,52 +2351,44 @@ See the property `annotations`. From c2601b37b73a04af9ec090a49799e381fba9a22e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 28 Jan 2023 14:20:46 -0300 Subject: [PATCH 13/70] Simplify DoNotUseThreads rule - No point in filterint out constructor calls, and then immediately search for them - If we already checked for the fiel / local var declaration type, no need to do it again --- .../src/main/resources/category/java/multithreading.xml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/multithreading.xml b/pmd-java/src/main/resources/category/java/multithreading.xml index 695953b076..f2511fdbac 100644 --- a/pmd-java/src/main/resources/category/java/multithreading.xml +++ b/pmd-java/src/main/resources/category/java/multithreading.xml @@ -159,14 +159,9 @@ Also, EJBs might be moved between machines in a cluster and only managed resourc ] )] (: exclude duplicated types on the same line :) -[not((parent::FieldDeclaration|parent::LocalVariableDeclaration)/VariableDeclarator/*[2][pmd-java:typeIs('java.lang.Thread') or pmd-java:typeIs('java.util.concurrent.ExecutorService')]) + [not((parent::FieldDeclaration|parent::LocalVariableDeclaration)/VariableDeclarator/*[2][pmd-java:typeIs('java.lang.Thread') or pmd-java:typeIs('java.util.concurrent.ExecutorService')]) or - @BeginLine != (parent::FieldDeclaration|parent::LocalVariableDeclaration)/VariableDeclarator/ConstructorCall/ClassOrInterfaceType[pmd-java:typeIs('java.lang.Thread') or pmd-java:typeIs('java.util.concurrent.ExecutorService')]/@BeginLine] - -(: exclude constructor call chains :) -[not(parent::ConstructorCall)] -| -//ConstructorCall/ClassOrInterfaceType[pmd-java:typeIs('java.lang.Thread')] + @BeginLine != (parent::FieldDeclaration|parent::LocalVariableDeclaration)/VariableDeclarator/ConstructorCall/ClassOrInterfaceType/@BeginLine] | //MethodCall[*[1][not(pmd-java:nodeIs('MethodCall'))][pmd-java:nodeIs('Expression') and (pmd-java:typeIs('java.util.concurrent.Executors') or pmd-java:typeIs('java.util.concurrent.ExecutorService'))]] From c46a2d31bf038b12f839586eac5dc932cf1e7797 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 14:55:43 +0100 Subject: [PATCH 14/70] [java] Add new language versions 20 and 20-preview --- docs/pages/pmd/languages/java.md | 11 +- docs/pages/pmd/userdocs/tools/ant.md | 4 +- pmd-java/etc/grammar/Java.jjt | 16 +- .../pmd/lang/java/JavaLanguageModule.java | 4 +- .../java/ast/Java18PreviewTreeDumpTest.java | 4 +- .../java/ast/Java19PreviewTreeDumpTest.java | 8 +- .../java/ast/Java20PreviewTreeDumpTest.java | 121 +++ .../pmd/lang/java/ast/KotlinTestingDsl.kt | 3 +- .../java20p/DealingWithNull.java | 90 +++ .../java20p/DealingWithNull.txt | 637 ++++++++++++++++ .../java20p/EnhancedTypeCheckingSwitch.java | 29 + .../java20p/EnhancedTypeCheckingSwitch.txt | 199 +++++ .../java20p/ExhaustiveSwitch.java | 95 +++ .../java20p/ExhaustiveSwitch.txt | 686 ++++++++++++++++++ .../GuardedAndParenthesizedPatterns.java | 80 ++ .../GuardedAndParenthesizedPatterns.txt | 662 +++++++++++++++++ .../java20p/PatternsInSwitchLabels.java | 22 + .../java20p/PatternsInSwitchLabels.txt | 150 ++++ .../java20p/RecordPatterns.java | 64 ++ .../java20p/RecordPatterns.txt | 467 ++++++++++++ .../java20p/RefiningPatternsInSwitch.java | 71 ++ .../java20p/RefiningPatternsInSwitch.txt | 452 ++++++++++++ .../ScopeOfPatternVariableDeclarations.java | 48 ++ .../ScopeOfPatternVariableDeclarations.txt | 241 ++++++ 24 files changed, 4143 insertions(+), 21 deletions(-) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index 477406fa08..fded9847ac 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -9,8 +9,10 @@ Usually the latest non-preview Java Version is the default version. | Java Version | Alias | Supported by PMD since | |--------------|-------|------------------------| +| 20-preview | | 6.55.0 | +| 20 (default) | | 6.55.0 | | 19-preview | | 6.48.0 | -| 19 (default) | | 6.48.0 | +| 19 | | 6.48.0 | | 18-preview | | 6.44.0 | | 18 | | 6.44.0 | | 17 | | 6.37.0 | @@ -32,13 +34,14 @@ Usually the latest non-preview Java Version is the default version. ## Using Java preview features In order to analyze a project with PMD that uses preview language features, you'll need to enable -it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `19-preview`: +it via the environment variable `PMD_JAVA_OPTS` and select the new language version, e.g. `20-preview`: export PMD_JAVA_OPTS=--enable-preview - ./run.sh pmd --use-version java-19-preview ... + ./run.sh pmd --use-version java-20-preview ... Note: we only support preview language features for the latest two java versions. -Note: `--use-version` is only supported since PMD 6.52.0. Older versions of PMD use two CLI options that have to be specified together: `-language java -version 19-preview`. +Note: `--use-version` is only supported since PMD 6.52.0. Older versions of PMD use two CLI options that have to +be specified together: `-language java -version 20-preview`. diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index 9cf33b6564..5b750dc99a 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -248,8 +248,10 @@ nested element. Possible values are: - + + + diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 0cd718f87b..8130c4409d 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -542,24 +542,24 @@ public class JavaParser { } private boolean isJEP406Supported() { - return (jdkVersion == 18 || jdkVersion == 19) && preview; + return (jdkVersion == 18 || jdkVersion == 19 || jdkVersion == 20) && preview; } private void checkForPatternMatchingInSwitch() { if (!isJEP406Supported()) { - throwParseException("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview."); + throwParseException("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); } } private void checkForNullCaseLabel() { if (!isJEP406Supported()) { - throwParseException("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview."); + throwParseException("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); } } private void checkForDefaultCaseLabel() { if (!isJEP406Supported()) { - throwParseException("Default case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview."); + throwParseException("Default case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); } } @@ -576,14 +576,14 @@ public class JavaParser { } private void checkForGuard() { - if (!((jdkVersion == 19) && preview)) { - throwParseException("Guards are only supported with JDK 19 Preview."); + if (!((jdkVersion == 19 || jdkVersion == 20) && preview)) { + throwParseException("Guards are only supported with JDK 19 Preview or JDK 20 Preview."); } } private void checkForRecordPatterns() { - if (!((jdkVersion == 19) && preview)) { - throwParseException("Record Patterns are only supported with JDK 19 Preview."); + if (!((jdkVersion == 19 || jdkVersion == 20) && preview)) { + throwParseException("Record Patterns are only supported with JDK 19 Preview or JDK 20 Preview."); } } 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 5a75b18018..854089f127 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 @@ -33,8 +33,10 @@ public class JavaLanguageModule extends BaseLanguageModule { addVersion("17", new JavaLanguageHandler(17)); addVersion("18", new JavaLanguageHandler(18)); addVersion("18-preview", new JavaLanguageHandler(18, true)); - addDefaultVersion("19", new JavaLanguageHandler(19)); // 19 is the default + addVersion("19", new JavaLanguageHandler(19)); addVersion("19-preview", new JavaLanguageHandler(19, true)); + addDefaultVersion("20", new JavaLanguageHandler(20)); // 20 is the default + addVersion("20-preview", new JavaLanguageHandler(20, true)); } } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java index 26647b33f9..4fd64f2a78 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java @@ -38,7 +38,7 @@ public class Java18PreviewTreeDumpTest extends BaseTreeDumpTest { } }); Assert.assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview.")); + thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -82,7 +82,7 @@ public class Java18PreviewTreeDumpTest extends BaseTreeDumpTest { } }); Assert.assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); } @Test diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java index 1e8c80cd5d..b64919ab61 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java @@ -40,7 +40,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview.")); + thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -67,7 +67,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -84,7 +84,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -116,6 +116,6 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Record Patterns are only supported with JDK 19 Preview.")); + thrown.getMessage().contains("Record Patterns are only supported with JDK 19 Preview or JDK 20 Preview.")); } } 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 new file mode 100644 index 0000000000..00bded708a --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java20PreviewTreeDumpTest.java @@ -0,0 +1,121 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.junit.function.ThrowingRunnable; + +import net.sourceforge.pmd.lang.ast.ParseException; +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.java.JavaParsingHelper; + +public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { + private final JavaParsingHelper java20p = + JavaParsingHelper.WITH_PROCESSING.withDefaultVersion("20-preview") + .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/"); + private final JavaParsingHelper java20 = java20p.withDefaultVersion("19"); + + public Java20PreviewTreeDumpTest() { + super(new RelevantAttributePrinter(), ".java"); + } + + @Override + public BaseParsingHelper getParser() { + return java20p; + } + + @Test + public void dealingWithNullBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { + @Override + public void run() throws Throwable { + java20.parseResource("DealingWithNull.java"); + } + }); + assertTrue("Unexpected message: " + thrown.getMessage(), + thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + } + + @Test + public void dealingWithNull() { + doTest("DealingWithNull"); + } + + @Test + public void enhancedTypeCheckingSwitch() { + doTest("EnhancedTypeCheckingSwitch"); + } + + @Test + public void exhaustiveSwitch() { + doTest("ExhaustiveSwitch"); + } + + @Test + public void guardedAndParenthesizedPatternsBeforeJava19Preview() { + ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { + @Override + public void run() throws Throwable { + java20.parseResource("GuardedAndParenthesizedPatterns.java"); + } + }); + assertTrue("Unexpected message: " + thrown.getMessage(), + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + } + + @Test + public void guardedAndParenthesizedPatterns() { + doTest("GuardedAndParenthesizedPatterns"); + } + + @Test + public void patternsInSwitchLabelsBeforeJava19Preview() { + ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { + @Override + public void run() throws Throwable { + java20.parseResource("PatternsInSwitchLabels.java"); + } + }); + assertTrue("Unexpected message: " + thrown.getMessage(), + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + } + + @Test + public void patternsInSwitchLabels() { + doTest("PatternsInSwitchLabels"); + } + + @Test + public void refiningPatternsInSwitch() { + doTest("RefiningPatternsInSwitch"); + } + + @Test + public void scopeOfPatternVariableDeclarations() { + doTest("ScopeOfPatternVariableDeclarations"); + } + + @Test + public void recordPatterns() { + doTest("RecordPatterns"); + } + + @Test + public void recordPatternsBeforeJava19Preview() { + ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { + @Override + public void run() throws Throwable { + java20.parseResource("RecordPatterns.java"); + } + }); + assertTrue("Unexpected message: " + thrown.getMessage(), + thrown.getMessage().contains("Record Patterns are only supported with JDK 19 Preview or JDK 20 Preview.")); + } +} 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 631207ee02..d08c744018 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 @@ -27,7 +27,8 @@ enum class JavaVersion : Comparable { J16, J17, J18, J18__PREVIEW, - J19, J19__PREVIEW; + J19, J19__PREVIEW, + J20, J20__PREVIEW; /** Name suitable for use with e.g. [JavaParsingHelper.parse] */ val pmdName: String = name.removePrefix("J").replaceFirst("__", "-").replace('_', '.').lowercase() 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 new file mode 100644 index 0000000000..990fcc2522 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.java @@ -0,0 +1,90 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third Preview) + */ +public class DealingWithNull { + + static void testFooBar(String s) { + switch (s) { + case null -> System.out.println("Oops"); + case "Foo", "Bar" -> System.out.println("Great"); + default -> System.out.println("Ok"); + } + } + + static void testStringOrNull(Object o) { + switch (o) { + case null, String s -> System.out.println("String: " + s); + case default -> System.out.print("default case"); + } + } + + static void test(Object o) { + switch (o) { + case null -> System.out.println("null!"); + case String s -> System.out.println("String"); + default -> System.out.println("Something else"); + } + } + + + 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: case String s: + System.out.println("String, including null"); + break; + default: + System.out.println("default case"); + break; + } + + switch(o) { + case null, String s -> System.out.println("String, including null"); + 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) { + test("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 new file mode 100644 index 0000000000..de92235cf5 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt @@ -0,0 +1,637 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "DealingWithNull", @Default = false, @Final = false, @Image = "DealingWithNull", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "DealingWithNull", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testFooBar", @Modifiers = 16, @Name = "testFooBar", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testFooBar", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Oops\"", @FloatLiteral = false, @Image = "\"Oops\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Oops\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Foo\"", @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Foo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Bar\"", @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Bar\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Great\"", @FloatLiteral = false, @Image = "\"Great\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Great\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ok\"", @FloatLiteral = false, @Image = "\"Ok\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ok\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testStringOrNull", @Modifiers = 16, @Name = "testStringOrNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testStringOrNull", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- NullLiteral[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String: \"", @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.print"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null!\"", @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Something else\"", @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Something else\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 16, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledThrowStatement[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "NullPointerException"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String: \"", @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Integer\"", @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Integer\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default\"", @FloatLiteral = false, @Image = "\"default\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test3", @Modifiers = 16, @Name = "test3", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test3", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- BreakStatement[] + | | +- SwitchLabel[@Default = true] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- Expression[@StandAlonePrimitive = false] + | | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | | +- NullLiteral[] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = true] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- SwitchLabel[@Default = true] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"The rest (including null)\"", @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"The rest (including null)\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- NullLiteral[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"The rest (including null)\"", @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"The rest (including null)\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test2"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- TryStatement[@Finally = false, @TryWithResources = false] + | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "test2"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- NullLiteral[] + | +- CatchStatement[@ExceptionName = "e", @MulticatchStatement = false] + | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "NullPointerException"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = true, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "e"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "e"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test3"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test3"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test3"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testFooBar"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testFooBar"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Foo\"", @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Foo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testFooBar"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Bar\"", @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Bar\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testFooBar"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"baz\"", @FloatLiteral = false, @Image = "\"baz\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"baz\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testStringOrNull"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "testStringOrNull"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"some string\"", @FloatLiteral = false, @Image = "\"some string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"some string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] 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 new file mode 100644 index 0000000000..ad8fe31898 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.java @@ -0,0 +1,29 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third 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); + } +} + +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 new file mode 100644 index 0000000000..15082ceb4e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt @@ -0,0 +1,199 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "EnhancedTypeCheckingSwitch", @Default = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "typeTester", @Modifiers = 16, @Name = "typeTester", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | | +- ResultType[@Void = true, @returnsArray = false] + | | +- MethodDeclarator[@Image = "typeTester", @ParameterCount = 1] + | | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- NullLiteral[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null\"", @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Color with \"", @FloatLiteral = false, @Image = "\"Color with \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Color with \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "c.values"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | | +- PrimarySuffix[@ArgumentCount = -1, @Arguments = false, @ArrayDereference = false, @Image = "length"] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\" values\"", @FloatLiteral = false, @Image = "\" values\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\" values\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Record class: \"", @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Record class: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "p.toString"] + | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "int"] + | | | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ia"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Array of ints of length\"", @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Array of ints of length\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "ia.length"] + | | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = true] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Something else\"", @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Something else\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "o"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "typeTester"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "o"] + +- TypeDeclaration[] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "j"] + | +- RecordBody[] + +- TypeDeclaration[] + +- EnumDeclaration[@Abstract = false, @BinaryName = "Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] + +- EnumBody[] + +- EnumConstant[@AnonymousClass = false, @Image = "RED"] + +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] + +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] 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 new file mode 100644 index 0000000000..44b5bb9fa7 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.java @@ -0,0 +1,95 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third Preview) + */ +public class ExhaustiveSwitch { + + static int coverage(Object o) { + return switch (o) { + case String s -> s.length(); + case Integer i -> i; + default -> 0; + }; + } + + static int coverageDefaultCase(Object o) { + return switch (o) { + case String s -> s.length(); + case Integer i -> i; + case 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())); + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..3c62b1a3e2 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt @@ -0,0 +1,686 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch", @Default = false, @Final = false, @Image = "ExhaustiveSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverage", @Modifiers = 16, @Name = "coverage", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | +- MethodDeclarator[@Image = "coverage", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- SwitchExpression[] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "s.length"] + | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "i"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "0", @FloatLiteral = false, @Image = "0", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "0", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverageDefaultCase", @Modifiers = 16, @Name = "coverageDefaultCase", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | +- MethodDeclarator[@Image = "coverageDefaultCase", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- SwitchExpression[] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "s.length"] + | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "i"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "0", @FloatLiteral = false, @Image = "0", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "0", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverageStatement", @Modifiers = 16, @Name = "coverageStatement", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "coverageStatement", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Integer\"", @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Integer\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- SwitchLabel[@Default = true] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- BreakStatement[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$S", @Default = false, @Final = false, @Image = "S", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "S", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] + | +- PermitsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$A", @Default = false, @Final = true, @Image = "A", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "A", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$B", @Default = false, @Final = true, @Image = "B", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "B", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$C", @Default = false, @Final = true, @Image = "C", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 1] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testSealedExhaustive", @Modifiers = 16, @Name = "testSealedExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | +- MethodDeclarator[@Image = "testSealedExhaustive", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "S"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- SwitchExpression[] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "switchStatementExhaustive", @Modifiers = 16, @Name = "switchStatementExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "switchStatementExhaustive", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "S"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "s"] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A\"", @FloatLiteral = false, @Image = "\"A\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- BreakStatement[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"C\"", @FloatLiteral = false, @Image = "\"C\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"C\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- BreakStatement[] + | | +- SwitchLabel[@Default = true] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case, should be B\"", @FloatLiteral = false, @Image = "\"default case, should be B\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case, should be B\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- EmptyStatement[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$I", @Default = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "I", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] + | +- TypeParameters[] + | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] + | +- PermitsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "E", @ReferenceToClassSameCompilationUnit = true] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$E", @Default = false, @Final = true, @Image = "E", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "E", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- TypeParameters[] + | | +- TypeParameter[@Image = "X", @Name = "X", @ParameterName = "X", @TypeBound = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$F", @Default = false, @Final = true, @Image = "F", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "F", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- TypeParameters[] + | | +- TypeParameter[@Image = "Y", @Name = "Y", @ParameterName = "Y", @TypeBound = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Y", @ReferenceToClassSameCompilationUnit = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testGenericSealedExhaustive", @Modifiers = 16, @Name = "testGenericSealedExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | +- MethodDeclarator[@Image = "testGenericSealedExhaustive", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- SwitchExpression[] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "i"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "F"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bi"] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverage"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a string\"", @FloatLiteral = false, @Image = "\"a string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverage"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverage"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverageStatement"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a string\"", @FloatLiteral = false, @Image = "\"a string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverageStatement"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "21", @FloatLiteral = false, @Image = "21", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "21", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 21, @ValueAsLong = 21] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "coverageStatement"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A:\"", @FloatLiteral = false, @Image = "\"A:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testSealedExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"B:\"", @FloatLiteral = false, @Image = "\"B:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"B:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testSealedExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"C:\"", @FloatLiteral = false, @Image = "\"C:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"C:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testSealedExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "switchStatementExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "switchStatementExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "switchStatementExhaustive"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + +- BlockStatement[@Allocation = true] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "System.out.println"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- AdditiveExpression[@Image = "+", @Operator = "+"] + +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"F:\"", @FloatLiteral = false, @Image = "\"F:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"F:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "testGenericSealedExhaustive"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- AllocationExpression[@AnonymousClass = false] + +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] + | +- TypeArguments[@Diamond = false] + | +- TypeArgument[@Wildcard = false] + | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + +- Arguments[@ArgumentCount = 0, @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 new file mode 100644 index 0000000000..2dd7da3f70 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.java @@ -0,0 +1,80 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third 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 + void testIdentifierWhen(String when) { + System.out.println(when); + } + + // verify that "when" can still be used as an identifier + 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"); + } + } + + 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); + } +} 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 new file mode 100644 index 0000000000..32b243ec05 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt @@ -0,0 +1,662 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "GuardedAndParenthesizedPatterns", @Default = false, @Final = false, @Image = "GuardedAndParenthesizedPatterns", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "s.length"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"single char string\"", @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"single char string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"string\"", @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "i.intValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"integer 1\"", @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"integer 1\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 1] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "l.longValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long 1 with parens\"", @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long 1 with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 3] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testIdentifierWhen", @Modifiers = 0, @Name = "testIdentifierWhen", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testIdentifierWhen", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "when", @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "when"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "when"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testIdentifierWhen", @Modifiers = 0, @Name = "testIdentifierWhen", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testIdentifierWhen", @ParameterCount = 0] + | | +- FormalParameters[@ParameterCount = 0, @Size = 0] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "when", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "when"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "when", @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "when"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "when"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @Default = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Modifiers = 20, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testWithNull", @Modifiers = 16, @Name = "testWithNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testWithNull", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "s.length"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"single char string\"", @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"single char string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"string\"", @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 1] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "i.intValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"integer 1\"", @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"integer 1\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 2] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "l.longValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long 1 with parens\"", @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long 1 with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 3] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null!\"", @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "instanceOfPattern", @Modifiers = 16, @Name = "instanceOfPattern", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "instanceOfPattern", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- IfStatement[@Else = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- ConditionalAndExpression[] + | | | +- InstanceOfExpression[] + | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "o"] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- RelationalExpression[@Image = ">"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "s.length"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least two characters\"", @FloatLiteral = false, @Image = "\"A string containing at least two characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least two characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- IfStatement[@Else = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- ConditionalAndExpression[] + | | | +- EqualityExpression[@Image = "!=", @Operator = "!="] + | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "o"] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- NullLiteral[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- ConditionalAndExpression[] + | | | +- InstanceOfExpression[] + | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "o"] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | | +- RelationalExpression[@Image = ">"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "s.length"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least three characters\"", @FloatLiteral = false, @Image = "\"A string containing at least three characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least three characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- ConditionalAndExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- InstanceOfExpression[] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "o"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Expression[@StandAlonePrimitive = false] + | | +- RelationalExpression[@Image = ">"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "s.length"] + | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "4", @FloatLiteral = false, @Image = "4", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "4", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 4, @ValueAsLong = 4] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least four characters\"", @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least four characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"fooo\"", @FloatLiteral = false, @Image = "\"fooo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"fooo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "instanceOfPattern"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"abcde\"", @FloatLiteral = false, @Image = "\"abcde\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"abcde\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- TryStatement[@Finally = false, @TryWithResources = false] + | +- Block[@containsComment = true] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "test"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- NullLiteral[] + | +- CatchStatement[@ExceptionName = "e", @MulticatchStatement = false] + | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "NullPointerException"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = true, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "e"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "e.printStackTrace"] + | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "testWithNull"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- NullLiteral[] 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 new file mode 100644 index 0000000000..a3ed038cb2 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.java @@ -0,0 +1,22 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third 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 new file mode 100644 index 0000000000..71557a780e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt @@ -0,0 +1,150 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "PatternsInSwitchLabels", @Default = false, @Final = false, @Image = "PatternsInSwitchLabels", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclarator[@Initializer = true, @Name = "o"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "123L", @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "123L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 123, @ValueAsLong = 123] + +- BlockStatement[@Allocation = false] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "formatted", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "formatted", @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "formatted"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- SwitchExpression[] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "String.format"] + | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"int %d\"", @FloatLiteral = false, @Image = "\"int %d\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"int %d\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "i"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "String.format"] + | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long %d\"", @FloatLiteral = false, @Image = "\"long %d\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long %d\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "l"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "String.format"] + | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double %f\"", @FloatLiteral = false, @Image = "\"double %f\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double %f\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "d"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "String.format"] + | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String %s\"", @FloatLiteral = false, @Image = "\"String %s\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String %s\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o.toString"] + | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "System.out.println"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Name[@Image = "formatted"] 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 new file mode 100644 index 0000000000..4a28b35b50 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.java @@ -0,0 +1,64 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 405: Record Patterns (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); + } + } + + // 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 patterns with generic types + record Box(T t) {} + void test1(Box bo) { + if (bo instanceof Box(String s)) { + System.out.println("String " + s); + } + } + void test2(Box bo) { + if (bo instanceof Box(var s)) { + System.out.println("String " + s); + } + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..1141e09861 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt @@ -0,0 +1,467 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatterns", @Default = false, @Final = false, @Image = "RecordPatterns", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.ENUM] + | +- EnumDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] + | +- EnumBody[] + | +- EnumConstant[@AnonymousClass = false, @Image = "RED"] + | +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] + | +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$ColoredPoint", @Default = false, @Final = true, @Image = "ColoredPoint", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "ColoredPoint", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Rectangle", @Default = false, @Final = true, @Image = "Rectangle", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Rectangle", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "upperLeft"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lowerRight"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printSum1", @Modifiers = 0, @Name = "printSum1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printSum1", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "p.x"] + | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- BlockStatement[@Allocation = false] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "p.y"] + | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "x"] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "y"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printSum2", @Modifiers = 0, @Name = "printSum2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printSum2", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "x"] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "y"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColoredPoint", @Modifiers = 0, @Name = "printUpperLeftColoredPoint", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printUpperLeftColoredPoint", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "r"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ul", @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ul"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "ul.c"] + | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printColorOfUpperLeftPoint", @Modifiers = 0, @Name = "printColorOfUpperLeftPoint", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printColorOfUpperLeftPoint", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "r"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- ComponentPatternList[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "c"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Modifiers = 0, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printXCoordOfUpperLeftPointWithPatterns", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "r"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- ComponentPatternList[] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | | +- ComponentPatternList[] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Upper-left corner: \"", @FloatLiteral = false, @Image = "\"Upper-left corner: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Upper-left corner: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "x"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Box", @Default = false, @Final = true, @Image = "Box", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Box", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- TypeParameters[] + | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] + | +- RecordComponentList[@Size = 1] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1", @Modifiers = 0, @Name = "test1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test1", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "bo"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "s"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 0, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- IfStatement[@Else = false] + +- Expression[@StandAlonePrimitive = false] + | +- InstanceOfExpression[] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "bo"] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- ComponentPatternList[] + | +- TypePattern[@ParenthesisDepth = 0] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + +- Statement[] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "System.out.println"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- AdditiveExpression[@Image = "+", @Operator = "+"] + +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Name[@Image = "s"] 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 new file mode 100644 index 0000000000..7cbd63a4b6 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.java @@ -0,0 +1,71 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third 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 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 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 new file mode 100644 index 0000000000..74f5d9dc3e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt @@ -0,0 +1,452 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch", @Default = false, @Final = false, @Image = "RefiningPatternsInSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @Default = false, @Final = false, @Image = "Shape", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Shape", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @Default = false, @Final = false, @Image = "Rectangle", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ExtendsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @Default = false, @Final = false, @Image = "Triangle", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Triangle", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ExtendsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.FIELD] + | | +- FieldDeclaration[@Abstract = false, @AnnotationMember = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @InterfaceMember = false, @Modifiers = 4, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @VariableName = "area", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclarator[@Initializer = false, @Name = "area"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = true, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "area"] + | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CONSTRUCTOR] + | | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @Image = "Triangle", @Kind = MethodLikeKind.CONSTRUCTOR, @Modifiers = 0, @Native = false, @PackagePrivate = true, @ParameterCount = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @Volatile = false, @containsComment = false] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "area"] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = true] + | | | +- PrimarySuffix[@ArgumentCount = -1, @Arguments = false, @ArrayDereference = false, @Image = "area"] + | | +- AssignmentOperator[@Compound = false, @Image = "="] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "area"] + | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "calculateArea", @Modifiers = 0, @Name = "calculateArea", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | +- MethodDeclarator[@Image = "calculateArea", @ParameterCount = 0] + | | +- FormalParameters[@ParameterCount = 0, @Size = 0] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "area"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangle", @Modifiers = 16, @Name = "testTriangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testTriangle", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabel[@Default = false] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- NullLiteral[] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- IfStatement[@Else = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- RelationalExpression[@Image = ">"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "t.calculateArea"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- SwitchLabel[@Default = true] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A shape, possibly a small triangle\"", @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A shape, possibly a small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangleRefined", @Modifiers = 16, @Name = "testTriangleRefined", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testTriangleRefined", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- RelationalExpression[@Image = ">"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "t.calculateArea"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A shape, possibly a small triangle\"", @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A shape, possibly a small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangleRefined2", @Modifiers = 16, @Name = "testTriangleRefined2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testTriangleRefined2", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | | | +- SwitchGuard[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- RelationalExpression[@Image = ">"] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "t.calculateArea"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Small triangle\"", @FloatLiteral = false, @Image = "\"Small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Non-triangle\"", @FloatLiteral = false, @Image = "\"Non-triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Non-triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = true] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "large", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclarator[@Initializer = true, @Name = "large"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "large", @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "large"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "200", @FloatLiteral = false, @Image = "200", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "200", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 200, @ValueAsLong = 200] + +- BlockStatement[@Allocation = true] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "small", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclarator[@Initializer = true, @Name = "small"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "small", @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "small"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "10", @FloatLiteral = false, @Image = "10", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "10", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 10, @ValueAsLong = 10] + +- BlockStatement[@Allocation = true] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "rect", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclarator[@Initializer = true, @Name = "rect"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "rect", @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "rect"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- AllocationExpression[@AnonymousClass = false] + | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = true] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangle"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "large"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangle"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "small"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangle"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "rect"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangleRefined"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "large"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangleRefined"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "small"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangleRefined"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "rect"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangleRefined2"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "large"] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testTriangleRefined2"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "small"] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "testTriangleRefined2"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Name[@Image = "rect"] 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 new file mode 100644 index 0000000000..471f1b1074 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.java @@ -0,0 +1,48 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * @see JEP 427: Pattern Matching for switch (Third Preview) + */ +public class ScopeOfPatternVariableDeclarations { + + + static void test(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(); + } + } + + + public static void main(String[] args) { + test('A'); + 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 new file mode 100644 index 0000000000..e2d6b63390 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt @@ -0,0 +1,241 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @Default = false, @Final = false, @Image = "ScopeOfPatternVariableDeclarations", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = true] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledBlock[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- IfStatement[@Else = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | | +- Name[@Image = "c.charValue"] + | | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] + | | | +- Statement[] + | | | +- Block[@containsComment = false] + | | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ding!\"", @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ding!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Character\"", @FloatLiteral = false, @Image = "\"Character\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Character\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledThrowStatement[] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "IllegalStateException"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "IllegalStateException", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Invalid Integer argument of value \"", @FloatLiteral = false, @Image = "\"Invalid Integer argument of value \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Invalid Integer argument of value \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "i.intValue"] + | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- SwitchLabeledBlock[] + | +- SwitchLabel[@Default = true] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- BreakStatement[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 16, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- IfStatement[@Else = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "c.charValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.print"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ding \"", @FloatLiteral = false, @Image = "\"Ding \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ding \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- IfStatement[@Else = false] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "c.charValue"] + | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "9", @FloatLiteral = false, @Image = "9", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "9", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 9, @ValueAsLong = 9] + | | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.print"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Tab \"", @FloatLiteral = false, @Image = "\"Tab \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Tab \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"character\"", @FloatLiteral = false, @Image = "\"character\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"character\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabel[@Default = true] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "test"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'A\'", @FloatLiteral = false, @Image = "\'A\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'A\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "test2"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = true] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'\\t\'", @FloatLiteral = false, @Image = "\'\\t\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'\\t\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] From 6f89a7f4a430dd5404d1ec111b853997a47b9b9e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 15:01:28 +0100 Subject: [PATCH 15/70] Bump org.ow2.asm:asm from 9.3 to 9.4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eab11df3e3..1b2dc4f628 100644 --- a/pom.xml +++ b/pom.xml @@ -733,7 +733,7 @@ org.ow2.asm asm - 9.3 + 9.4 net.sourceforge.pmd From 35a11574ed63ab4e5737b52f94d4b30fb55f950c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 15:49:19 +0100 Subject: [PATCH 16/70] [java] Remove language version 18-preview --- docs/pages/pmd/languages/java.md | 1 - docs/pages/pmd/userdocs/tools/ant.md | 1 - docs/pages/release_notes.md | 4 + pmd-java/etc/grammar/Java.jjt | 41 +- .../pmd/lang/java/JavaLanguageModule.java | 1 - .../pmd/lang/java/ast/ASTGuardedPattern.java | 60 -- .../pmd/lang/java/ast/AstImplUtil.java | 3 - .../java/ast/JavaParserDecoratedVisitor.java | 8 - .../java/ast/JavaParserVisitorAdapter.java | 7 - .../java/ast/JavaParserVisitorDecorator.java | 7 - .../pmd/lang/java/rule/AbstractJavaRule.java | 8 - .../pmd/lang/java/JavaLanguageModuleTest.java | 6 +- .../lang/java/ast/AllJavaAstTreeDumpTest.java | 4 +- .../java/ast/Java18PreviewTreeDumpTest.java | 102 --- .../java/ast/Java19PreviewTreeDumpTest.java | 6 +- .../java/ast/Java20PreviewTreeDumpTest.java | 14 +- .../pmd/lang/java/ast/KotlinTestingDsl.kt | 2 +- .../java18p/DealingWithNull.java | 90 --- .../java18p/DealingWithNull.txt | 637 ------------------ .../java18p/EnhancedTypeCheckingSwitch.java | 29 - .../java18p/EnhancedTypeCheckingSwitch.txt | 199 ------ .../java18p/ExhaustiveSwitch.java | 87 --- .../java18p/ExhaustiveSwitch.txt | 634 ----------------- .../GuardedAndParenthesizedPatterns.java | 60 -- .../GuardedAndParenthesizedPatterns.txt | 590 ---------------- .../java18p/PatternsInSwitchLabels.java | 22 - .../java18p/PatternsInSwitchLabels.txt | 150 ----- .../java18p/RefiningPatternsInSwitch.java | 71 -- .../java18p/RefiningPatternsInSwitch.txt | 456 ------------- .../ScopeOfPatternVariableDeclarations.java | 48 -- .../ScopeOfPatternVariableDeclarations.txt | 241 ------- 31 files changed, 32 insertions(+), 3557 deletions(-) delete mode 100644 pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuardedPattern.java delete mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.txt delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.java delete mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.txt diff --git a/docs/pages/pmd/languages/java.md b/docs/pages/pmd/languages/java.md index fded9847ac..c44939d6ab 100644 --- a/docs/pages/pmd/languages/java.md +++ b/docs/pages/pmd/languages/java.md @@ -13,7 +13,6 @@ Usually the latest non-preview Java Version is the default version. | 20 (default) | | 6.55.0 | | 19-preview | | 6.48.0 | | 19 | | 6.48.0 | -| 18-preview | | 6.44.0 | | 18 | | 6.44.0 | | 17 | | 6.37.0 | | 16 | | 6.32.0 | diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index 5b750dc99a..1eb50d8d0e 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -247,7 +247,6 @@ nested element. Possible values are: - diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index b8f8783555..54c9cdb1ae 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -18,6 +18,10 @@ This is a {{ site.pmd.release_type }} release. ### API Changes +#### Java +* Support for Java 18 preview language features have been removed. The version "18-preview" is no longer available. +* The experimental class `net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern` has been removed. + ### External Contributions {% endtocmaker %} diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 8130c4409d..47a3cf5ed1 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -542,36 +542,30 @@ public class JavaParser { } private boolean isJEP406Supported() { - return (jdkVersion == 18 || jdkVersion == 19 || jdkVersion == 20) && preview; + return (jdkVersion == 19 || jdkVersion == 20) && preview; } private void checkForPatternMatchingInSwitch() { if (!isJEP406Supported()) { - throwParseException("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); + throwParseException("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview."); } } private void checkForNullCaseLabel() { if (!isJEP406Supported()) { - throwParseException("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); + throwParseException("Null case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview."); } } private void checkForDefaultCaseLabel() { if (!isJEP406Supported()) { - throwParseException("Default case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview."); + throwParseException("Default case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview."); } } - private void checkForGuardedPatterns() { - if (!((jdkVersion == 18) && preview)) { - throwParseException("Guarded patterns are only supported with JDK 18 Preview."); - } - } - - private void checkForParenthesizedInstanceOfPattern() { - if (!((jdkVersion == 18) && preview)) { - throwParseException("Parenthesized InstanceOf patterns are only supported with JDK 18 Preview."); + private void checkForParenthesizedPattern() { + if (!((jdkVersion == 19 || jdkVersion == 20) && preview)) { + throwParseException("Parenthesized patterns are only supported with JDK 19 Preview or JDK 20 Preview."); } } @@ -1804,23 +1798,17 @@ void Pattern() #void: { LOOKAHEAD((Annotation())* ReferenceType() "(") RecordPattern() | LOOKAHEAD("(") ParenthesizedPattern() - | TypePattern() [ GuardedPatternCondition() #GuardedPattern(2) {checkForGuardedPatterns();} ] -} - -void GuardedPatternCondition() #void: -{} -{ - "&&" ConditionalAndExpression() + | TypePattern() } void ParenthesizedPattern() #void: -{} +{checkForParenthesizedPattern();} { "(" Pattern() ")" { AstImplUtil.bumpParenDepth((ASTPattern) jjtree.peekNode()); } } void TypePattern(): -{} +{checkforBadInstanceOfPattern();} { ( "final" {jjtThis.setFinal(true);} | Annotation() )* Type() @@ -1851,13 +1839,8 @@ void InstanceOfExpression() #InstanceOfExpression(>1): RelationalExpression() [ "instanceof" ( - // Note: this can be simplified when support for java 18 preview is removed. - // Here the production Pattern is inlined to avoid that a following conditional && - // be parsed as a pattern guard. - LOOKAHEAD("final" | (Annotation())* Type() ) {checkforBadInstanceOfPattern();} TypePattern() - | LOOKAHEAD((Annotation())* ReferenceType() "(") {checkForRecordPatterns();} RecordPattern() - | LOOKAHEAD("(") {checkForParenthesizedInstanceOfPattern();} ParenthesizedPattern() - | (Annotation())* Type() + LOOKAHEAD(Pattern()) Pattern() + | (Annotation())* Type() ) ] } 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 854089f127..27c6a924fe 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 @@ -32,7 +32,6 @@ public class JavaLanguageModule extends BaseLanguageModule { addVersion("16", new JavaLanguageHandler(16)); addVersion("17", new JavaLanguageHandler(17)); addVersion("18", new JavaLanguageHandler(18)); - addVersion("18-preview", new JavaLanguageHandler(18, true)); addVersion("19", new JavaLanguageHandler(19)); addVersion("19-preview", new JavaLanguageHandler(19, true)); addDefaultVersion("20", new JavaLanguageHandler(20)); // 20 is the default diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuardedPattern.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuardedPattern.java deleted file mode 100644 index 12f3998061..0000000000 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTGuardedPattern.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.java.ast; - -import net.sourceforge.pmd.annotation.Experimental; - -/** - * A guarded pattern (JDK17 Preview). This can be found - * in {@link ASTSwitchLabel}s. - * - *
- *
- * GuardedPattern ::= {@linkplain ASTPattern Pattern} "&&" {@linkplain ASTConditionalAndExpression ConditionalAndExpression}
- *
- * 
- * - * @see JEP 406: Pattern Matching for switch (Preview) - * - * @deprecated This is not used with java 19 preview anymore. Only valid for java 18 preview. -*/ -@Experimental -@Deprecated -public final class ASTGuardedPattern extends AbstractJavaNode implements ASTPattern { - - private int parenDepth; - - ASTGuardedPattern(int id) { - super(id); - } - - ASTGuardedPattern(JavaParser p, int id) { - super(p, id); - } - - - @Override - public Object jjtAccept(JavaParserVisitor visitor, Object data) { - return visitor.visit(this, data); - } - - public ASTPattern getPattern() { - return (ASTPattern) getChild(0); - } - - public JavaNode getGuard() { - return getChild(1); - } - - void bumpParenDepth() { - parenDepth++; - } - - @Override - @Experimental - public int getParenthesisDepth() { - return parenDepth; - } -} 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 7c467a4c43..f54d0be381 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 @@ -15,15 +15,12 @@ final class AstImplUtil { static void bumpParenDepth(ASTPattern pattern) { assert pattern instanceof ASTTypePattern || pattern instanceof ASTRecordPattern - || pattern instanceof ASTGuardedPattern : pattern.getClass() + " doesn't have parenDepth attribute!"; if (pattern instanceof ASTTypePattern) { ((ASTTypePattern) pattern).bumpParenDepth(); } else if (pattern instanceof ASTRecordPattern) { ((ASTRecordPattern) pattern).bumpParenDepth(); - } else if (pattern instanceof ASTGuardedPattern) { - ((ASTGuardedPattern) pattern).bumpParenDepth(); } } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserDecoratedVisitor.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserDecoratedVisitor.java index 68cc6d02bc..24d07529c2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserDecoratedVisitor.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserDecoratedVisitor.java @@ -943,14 +943,6 @@ public class JavaParserDecoratedVisitor implements JavaParserVisitor { return visit((JavaNode) node, data); } - @Experimental - @Deprecated - @Override - public Object visit(ASTGuardedPattern node, Object data) { - visitor.visit(node, data); - return visit((JavaNode) node, data); - } - @Experimental @Override public Object visit(ASTSwitchGuard node, Object data) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.java index d1e64f15fb..15f0691751 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorAdapter.java @@ -663,13 +663,6 @@ public class JavaParserVisitorAdapter implements JavaParserVisitor { return visit((JavaNode) node, data); } - @Experimental - @Deprecated - @Override - public Object visit(ASTGuardedPattern node, Object data) { - return visit((JavaNode) node, data); - } - @Experimental @Override public Object visit(ASTSwitchGuard node, Object data) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.java index 8f558ae61e..14f4ed1201 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/JavaParserVisitorDecorator.java @@ -795,13 +795,6 @@ public class JavaParserVisitorDecorator implements JavaParserControllessVisitor return visitor.visit(node, data); } - @Experimental - @Deprecated - @Override - public Object visit(ASTGuardedPattern node, Object data) { - return visitor.visit(node, data); - } - @Experimental @Override public Object visit(ASTSwitchGuard node, Object data) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java index eaf3b33470..507bb8201b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.java @@ -61,7 +61,6 @@ import net.sourceforge.pmd.lang.java.ast.ASTForStatement; import net.sourceforge.pmd.lang.java.ast.ASTForUpdate; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters; -import net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern; import net.sourceforge.pmd.lang.java.ast.ASTIfStatement; import net.sourceforge.pmd.lang.java.ast.ASTImplementsList; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; @@ -878,13 +877,6 @@ public abstract class AbstractJavaRule extends AbstractRule implements JavaParse } - @Experimental - @Deprecated - @Override - public Object visit(ASTGuardedPattern node, Object data) { - return visit((JavaNode) node, data); - } - @Experimental @Override public Object visit(ASTSwitchGuard node, Object data) { 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 3dcafd789f..357ab53037 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 @@ -26,10 +26,10 @@ public class JavaLanguageModuleTest { @Test public void previewVersionShouldBeGreaterThanNonPreview() { - LanguageVersion java18 = javaLanguage.getVersion("18"); - LanguageVersion java18p = javaLanguage.getVersion("18-preview"); + LanguageVersion java20 = javaLanguage.getVersion("20"); + LanguageVersion java20p = javaLanguage.getVersion("20-preview"); - Assert.assertTrue("java18-preview should be greater than java18", java18p.compareTo(java18) > 0); + Assert.assertTrue("java20-preview should be greater than java20", java20p.compareTo(java20) > 0); } @Test 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 025a81bd45..0442485d33 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 @@ -14,8 +14,8 @@ import org.junit.runners.Suite.SuiteClasses; Java15TreeDumpTest.class, Java16TreeDumpTest.class, Java17TreeDumpTest.class, - Java18PreviewTreeDumpTest.class, - Java19PreviewTreeDumpTest.class + Java19PreviewTreeDumpTest.class, + Java20PreviewTreeDumpTest.class }) public class AllJavaAstTreeDumpTest { diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java deleted file mode 100644 index 4fd64f2a78..0000000000 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java18PreviewTreeDumpTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -package net.sourceforge.pmd.lang.java.ast; - -import org.junit.Assert; -import org.junit.Test; -import org.junit.function.ThrowingRunnable; - -import net.sourceforge.pmd.lang.ast.ParseException; -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.java.JavaParsingHelper; - -public class Java18PreviewTreeDumpTest extends BaseTreeDumpTest { - private final JavaParsingHelper java18p = - JavaParsingHelper.WITH_PROCESSING.withDefaultVersion("18-preview") - .withResourceContext(Java18PreviewTreeDumpTest.class, "jdkversiontests/java18p/"); - private final JavaParsingHelper java18 = java18p.withDefaultVersion("18"); - - public Java18PreviewTreeDumpTest() { - super(new RelevantAttributePrinter(), ".java"); - } - - @Override - public BaseParsingHelper getParser() { - return java18p; - } - - @Test - public void dealingWithNullBeforeJava18Preview() { - ParseException thrown = Assert.assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java18.parseResource("DealingWithNull.java"); - } - }); - Assert.assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); - } - - @Test - public void dealingWithNull() { - doTest("DealingWithNull"); - } - - @Test - public void enhancedTypeCheckingSwitch() { - doTest("EnhancedTypeCheckingSwitch"); - } - - @Test - public void exhaustiveSwitch() { - doTest("ExhaustiveSwitch"); - } - - @Test - public void guardedAndParenthesizedPatternsBeforeJava18Preview() { - ParseException thrown = Assert.assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java18.parseResource("GuardedAndParenthesizedPatterns.java"); - } - }); - Assert.assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Guarded patterns are only supported with JDK 18 Preview.")); - } - - @Test - public void guardedAndParenthesizedPatterns() { - doTest("GuardedAndParenthesizedPatterns"); - } - - @Test - public void patternsInSwitchLabelsBeforeJava18Preview() { - ParseException thrown = Assert.assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java18.parseResource("PatternsInSwitchLabels.java"); - } - }); - Assert.assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); - } - - @Test - public void patternsInSwitchLabels() { - doTest("PatternsInSwitchLabels"); - } - - @Test - public void refiningPatternsInSwitch() { - doTest("RefiningPatternsInSwitch"); - } - - @Test - public void scopeOfPatternVariableDeclarations() { - doTest("ScopeOfPatternVariableDeclarations"); - } -} diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java index b64919ab61..70b6487c6f 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java @@ -40,7 +40,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Null case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -67,7 +67,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -84,7 +84,7 @@ public class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test 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 index 00bded708a..7cf4746d64 100644 --- 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 @@ -20,7 +20,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { private final JavaParsingHelper java20p = JavaParsingHelper.WITH_PROCESSING.withDefaultVersion("20-preview") .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/"); - private final JavaParsingHelper java20 = java20p.withDefaultVersion("19"); + private final JavaParsingHelper java20 = java20p.withDefaultVersion("20"); public Java20PreviewTreeDumpTest() { super(new RelevantAttributePrinter(), ".java"); @@ -40,7 +40,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Null case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -59,7 +59,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } @Test - public void guardedAndParenthesizedPatternsBeforeJava19Preview() { + public void guardedAndParenthesizedPatternsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { @@ -67,7 +67,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -76,7 +76,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } @Test - public void patternsInSwitchLabelsBeforeJava19Preview() { + public void patternsInSwitchLabelsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { @@ -84,7 +84,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } }); assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 18 Preview or JDK 19 Preview or JDK 20 Preview.")); + thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); } @Test @@ -108,7 +108,7 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } @Test - public void recordPatternsBeforeJava19Preview() { + public void recordPatternsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { 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 d08c744018..f8be48f624 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 @@ -26,7 +26,7 @@ enum class JavaVersion : Comparable { J15, J16, J17, - J18, J18__PREVIEW, + J18, J19, J19__PREVIEW, J20, J20__PREVIEW; diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.java deleted file mode 100644 index fcb7d01c83..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second Preview) - */ -public class DealingWithNull { - - static void testFooBar(String s) { - switch (s) { - case null -> System.out.println("Oops"); - case "Foo", "Bar" -> System.out.println("Great"); - default -> System.out.println("Ok"); - } - } - - static void testStringOrNull(Object o) { - switch (o) { - case null, String s -> System.out.println("String: " + s); - case default -> System.out.print("default case"); - } - } - - static void test(Object o) { - switch (o) { - case null -> System.out.println("null!"); - case String s -> System.out.println("String"); - default -> System.out.println("Something else"); - } - } - - - 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: case String s: - System.out.println("String, including null"); - break; - default: - System.out.println("default case"); - break; - } - - switch(o) { - case null, String s -> System.out.println("String, including null"); - 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) { - test("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/java18p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.txt deleted file mode 100644 index de92235cf5..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/DealingWithNull.txt +++ /dev/null @@ -1,637 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "DealingWithNull", @Default = false, @Final = false, @Image = "DealingWithNull", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "DealingWithNull", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testFooBar", @Modifiers = 16, @Name = "testFooBar", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testFooBar", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Oops\"", @FloatLiteral = false, @Image = "\"Oops\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Oops\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Foo\"", @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Foo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Bar\"", @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Bar\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Great\"", @FloatLiteral = false, @Image = "\"Great\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Great\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ok\"", @FloatLiteral = false, @Image = "\"Ok\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ok\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testStringOrNull", @Modifiers = 16, @Name = "testStringOrNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testStringOrNull", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String: \"", @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.print"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null!\"", @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Something else\"", @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Something else\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 16, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledThrowStatement[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "NullPointerException"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String: \"", @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Integer\"", @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Integer\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default\"", @FloatLiteral = false, @Image = "\"default\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test3", @Modifiers = 16, @Name = "test3", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test3", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- BreakStatement[] - | | +- SwitchLabel[@Default = true] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | | +- NullLiteral[] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = true] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- SwitchLabel[@Default = true] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"The rest (including null)\"", @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"The rest (including null)\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"The rest (including null)\"", @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"The rest (including null)\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test2"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- TryStatement[@Finally = false, @TryWithResources = false] - | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "test2"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] - | +- CatchStatement[@ExceptionName = "e", @MulticatchStatement = false] - | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "NullPointerException"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = true, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "e"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "e"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test3"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test3"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test3"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- NullLiteral[] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testFooBar"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- NullLiteral[] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testFooBar"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Foo\"", @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Foo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testFooBar"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Bar\"", @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Bar\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testFooBar"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"baz\"", @FloatLiteral = false, @Image = "\"baz\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"baz\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testStringOrNull"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- NullLiteral[] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "testStringOrNull"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"some string\"", @FloatLiteral = false, @Image = "\"some string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"some string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.java deleted file mode 100644 index 96118f9bb7..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second 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); - } -} - -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/java18p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.txt deleted file mode 100644 index 15082ceb4e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/EnhancedTypeCheckingSwitch.txt +++ /dev/null @@ -1,199 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "EnhancedTypeCheckingSwitch", @Default = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "typeTester", @Modifiers = 16, @Name = "typeTester", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | | +- ResultType[@Void = true, @returnsArray = false] - | | +- MethodDeclarator[@Image = "typeTester", @ParameterCount = 1] - | | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null\"", @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Color with \"", @FloatLiteral = false, @Image = "\"Color with \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Color with \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "c.values"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | | +- PrimarySuffix[@ArgumentCount = -1, @Arguments = false, @ArrayDereference = false, @Image = "length"] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\" values\"", @FloatLiteral = false, @Image = "\" values\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\" values\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Record class: \"", @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Record class: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "p.toString"] - | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | +- SwitchLabeledExpression[] - | | | +- SwitchLabel[@Default = false] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "int"] - | | | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ia"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Array of ints of length\"", @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Array of ints of length\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "ia.length"] - | | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = true] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Something else\"", @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Something else\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "typeTester"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "o"] - +- TypeDeclaration[] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "j"] - | +- RecordBody[] - +- TypeDeclaration[] - +- EnumDeclaration[@Abstract = false, @BinaryName = "Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] - +- EnumBody[] - +- EnumConstant[@AnonymousClass = false, @Image = "RED"] - +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] - +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.java deleted file mode 100644 index d2e35ec75a..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second 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())); - } -} \ No newline at end of file diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.txt deleted file mode 100644 index 99203d9819..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ExhaustiveSwitch.txt +++ /dev/null @@ -1,634 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch", @Default = false, @Final = false, @Image = "ExhaustiveSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverage", @Modifiers = 16, @Name = "coverage", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | +- MethodDeclarator[@Image = "coverage", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- SwitchExpression[] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "s.length"] - | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "i"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "0", @FloatLiteral = false, @Image = "0", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "0", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverageStatement", @Modifiers = 16, @Name = "coverageStatement", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "coverageStatement", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Integer\"", @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Integer\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- SwitchLabel[@Default = true] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- BreakStatement[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$S", @Default = false, @Final = false, @Image = "S", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "S", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] - | +- PermitsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$A", @Default = false, @Final = true, @Image = "A", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "A", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$B", @Default = false, @Final = true, @Image = "B", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "B", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$C", @Default = false, @Final = true, @Image = "C", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 1] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testSealedExhaustive", @Modifiers = 16, @Name = "testSealedExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | +- MethodDeclarator[@Image = "testSealedExhaustive", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "S"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- SwitchExpression[] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] - | | +- Expression[@StandAlonePrimitive = true] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] - | | +- Expression[@StandAlonePrimitive = true] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "switchStatementExhaustive", @Modifiers = 16, @Name = "switchStatementExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "switchStatementExhaustive", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "S"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "S", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "s"] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A\"", @FloatLiteral = false, @Image = "\"A\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- BreakStatement[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"C\"", @FloatLiteral = false, @Image = "\"C\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"C\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- BreakStatement[] - | | +- SwitchLabel[@Default = true] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case, should be B\"", @FloatLiteral = false, @Image = "\"default case, should be B\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case, should be B\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- EmptyStatement[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$I", @Default = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "I", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] - | +- TypeParameters[] - | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] - | +- PermitsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "E", @ReferenceToClassSameCompilationUnit = true] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$E", @Default = false, @Final = true, @Image = "E", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "E", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- TypeParameters[] - | | +- TypeParameter[@Image = "X", @Name = "X", @ParameterName = "X", @TypeBound = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ExhaustiveSwitch$F", @Default = false, @Final = true, @Image = "F", @Interface = false, @Local = false, @Modifiers = 48, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "F", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- TypeParameters[] - | | +- TypeParameter[@Image = "Y", @Name = "Y", @ParameterName = "Y", @TypeBound = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Y", @ReferenceToClassSameCompilationUnit = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testGenericSealedExhaustive", @Modifiers = 16, @Name = "testGenericSealedExhaustive", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | +- MethodDeclarator[@Image = "testGenericSealedExhaustive", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- SwitchExpression[] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "i"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "F"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bi"] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverage"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a string\"", @FloatLiteral = false, @Image = "\"a string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverage"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverage"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverageStatement"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a string\"", @FloatLiteral = false, @Image = "\"a string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverageStatement"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "21", @FloatLiteral = false, @Image = "21", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "21", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 21, @ValueAsLong = 21] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "coverageStatement"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A:\"", @FloatLiteral = false, @Image = "\"A:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testSealedExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"B:\"", @FloatLiteral = false, @Image = "\"B:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"B:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testSealedExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"C:\"", @FloatLiteral = false, @Image = "\"C:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"C:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testSealedExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "switchStatementExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "switchStatementExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "switchStatementExhaustive"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] - +- BlockStatement[@Allocation = true] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "System.out.println"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- AdditiveExpression[@Image = "+", @Operator = "+"] - +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"F:\"", @FloatLiteral = false, @Image = "\"F:\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"F:\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "testGenericSealedExhaustive"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- AllocationExpression[@AnonymousClass = false] - +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "F", @ReferenceToClassSameCompilationUnit = true] - | +- TypeArguments[@Diamond = false] - | +- TypeArgument[@Wildcard = false] - | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - +- Arguments[@ArgumentCount = 0, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.java deleted file mode 100644 index 1a4663701f..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second Preview) - */ -public class GuardedAndParenthesizedPatterns { - - - static void test(Object o) { - switch (o) { - case String s && (s.length() == 1) -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case (Integer i && i.intValue() == 1) -> System.out.println("integer 1"); - case (((Long l && 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"); - } - } - - static void testWithNull(Object o) { - switch (o) { - case String s && (s.length() == 1) -> System.out.println("single char string"); - case String s -> System.out.println("string"); - case (Integer i && i.intValue() == 1) -> System.out.println("integer 1"); - case (((Long l && 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"); - } - if (o instanceof (String s && s.length() > 4)) { - System.out.println("A string containing at least four characters"); - } - } - - 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); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.txt deleted file mode 100644 index c55afb51bf..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.txt +++ /dev/null @@ -1,590 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "GuardedAndParenthesizedPatterns", @Default = false, @Final = false, @Image = "GuardedAndParenthesizedPatterns", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 0] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "s.length"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"single char string\"", @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"single char string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"string\"", @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 1] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "i.intValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"integer 1\"", @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"integer 1\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 3] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "l.longValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long 1 with parens\"", @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long 1 with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 3] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testWithNull", @Modifiers = 16, @Name = "testWithNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testWithNull", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 0] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "s.length"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"single char string\"", @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"single char string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"string\"", @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 1] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "i.intValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"integer 1\"", @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"integer 1\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 3] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "l.longValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long 1 with parens\"", @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long 1 with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 3] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null!\"", @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "instanceOfPattern", @Modifiers = 16, @Name = "instanceOfPattern", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "instanceOfPattern", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- IfStatement[@Else = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- ConditionalAndExpression[] - | | | +- InstanceOfExpression[] - | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "o"] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- RelationalExpression[@Image = ">"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "s.length"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least two characters\"", @FloatLiteral = false, @Image = "\"A string containing at least two characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least two characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- IfStatement[@Else = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- ConditionalAndExpression[] - | | | +- EqualityExpression[@Image = "!=", @Operator = "!="] - | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "o"] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- ConditionalAndExpression[] - | | | +- InstanceOfExpression[] - | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "o"] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | | +- RelationalExpression[@Image = ">"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "s.length"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] - | | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least three characters\"", @FloatLiteral = false, @Image = "\"A string containing at least three characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least three characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- GuardedPattern[@ParenthesisDepth = 1] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- RelationalExpression[@Image = ">"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "s.length"] - | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "4", @FloatLiteral = false, @Image = "4", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "4", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 4, @ValueAsLong = 4] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least four characters\"", @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least four characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"fooo\"", @FloatLiteral = false, @Image = "\"fooo\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"fooo\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1L", @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "instanceOfPattern"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"abcde\"", @FloatLiteral = false, @Image = "\"abcde\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"abcde\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- TryStatement[@Finally = false, @TryWithResources = false] - | +- Block[@containsComment = true] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "test"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] - | +- CatchStatement[@ExceptionName = "e", @MulticatchStatement = false] - | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "NullPointerException"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "NullPointerException", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = true, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "e"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "e.printStackTrace"] - | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "testWithNull"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- NullLiteral[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.java deleted file mode 100644 index 70c4401a17..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second 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/java18p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.txt deleted file mode 100644 index 71557a780e..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/PatternsInSwitchLabels.txt +++ /dev/null @@ -1,150 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "PatternsInSwitchLabels", @Default = false, @Final = false, @Image = "PatternsInSwitchLabels", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "123L", @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @LongLiteral = true, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "123L", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 123, @ValueAsLong = 123] - +- BlockStatement[@Allocation = false] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "formatted", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "formatted", @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "formatted"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- SwitchExpression[] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "String.format"] - | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"int %d\"", @FloatLiteral = false, @Image = "\"int %d\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"int %d\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "i"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Long"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Long", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "l"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "String.format"] - | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long %d\"", @FloatLiteral = false, @Image = "\"long %d\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long %d\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "l"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Double"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Double", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "String.format"] - | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double %f\"", @FloatLiteral = false, @Image = "\"double %f\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double %f\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "d"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "String.format"] - | | +- PrimarySuffix[@ArgumentCount = 2, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String %s\"", @FloatLiteral = false, @Image = "\"String %s\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String %s\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o.toString"] - | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "System.out.println"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Name[@Image = "formatted"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.java deleted file mode 100644 index 79fea58634..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second 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 Triangle t && (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 Triangle t && (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/java18p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.txt deleted file mode 100644 index 8af1afb7bc..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.txt +++ /dev/null @@ -1,456 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch", @Default = false, @Final = false, @Image = "RefiningPatternsInSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @Default = false, @Final = false, @Image = "Shape", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Shape", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @Default = false, @Final = false, @Image = "Rectangle", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ExtendsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @Default = false, @Final = false, @Image = "Triangle", @Interface = false, @Local = false, @Modifiers = 16, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "Triangle", @Static = true, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ExtendsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.FIELD] - | | +- FieldDeclaration[@Abstract = false, @AnnotationMember = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @InterfaceMember = false, @Modifiers = 4, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @VariableName = "area", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclarator[@Initializer = false, @Name = "area"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = true, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "area"] - | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CONSTRUCTOR] - | | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @Image = "Triangle", @Kind = MethodLikeKind.CONSTRUCTOR, @Modifiers = 0, @Native = false, @PackagePrivate = true, @ParameterCount = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @Volatile = false, @containsComment = false] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "area"] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = true] - | | | +- PrimarySuffix[@ArgumentCount = -1, @Arguments = false, @ArrayDereference = false, @Image = "area"] - | | +- AssignmentOperator[@Compound = false, @Image = "="] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "area"] - | +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "calculateArea", @Modifiers = 0, @Name = "calculateArea", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | +- MethodDeclarator[@Image = "calculateArea", @ParameterCount = 0] - | | +- FormalParameters[@ParameterCount = 0, @Size = 0] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "area"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangle", @Modifiers = 16, @Name = "testTriangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testTriangle", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabel[@Default = false] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- IfStatement[@Else = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- RelationalExpression[@Image = ">"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "t.calculateArea"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- BreakStatement[] - | +- SwitchLabel[@Default = true] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A shape, possibly a small triangle\"", @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A shape, possibly a small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangleRefined", @Modifiers = 16, @Name = "testTriangleRefined", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testTriangleRefined", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 0] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- RelationalExpression[@Image = ">"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "t.calculateArea"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A shape, possibly a small triangle\"", @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A shape, possibly a small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testTriangleRefined2", @Modifiers = 16, @Name = "testTriangleRefined2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "testTriangleRefined2", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Shape"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Shape", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "s"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- GuardedPattern[@ParenthesisDepth = 0] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- RelationalExpression[@Image = ">"] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "t.calculateArea"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "100", @FloatLiteral = false, @Image = "100", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "100", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 100, @ValueAsLong = 100] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Large triangle\"", @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Large triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Small triangle\"", @FloatLiteral = false, @Image = "\"Small triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Small triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Non-triangle\"", @FloatLiteral = false, @Image = "\"Non-triangle\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Non-triangle\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = true] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "large", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclarator[@Initializer = true, @Name = "large"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "large", @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "large"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "200", @FloatLiteral = false, @Image = "200", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "200", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 200, @ValueAsLong = 200] - +- BlockStatement[@Allocation = true] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "small", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Triangle"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclarator[@Initializer = true, @Name = "small"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "small", @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "small"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Triangle", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "10", @FloatLiteral = false, @Image = "10", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "10", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 10, @ValueAsLong = 10] - +- BlockStatement[@Allocation = true] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "rect", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclarator[@Initializer = true, @Name = "rect"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "rect", @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "rect"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- AllocationExpression[@AnonymousClass = false] - | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = true] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangle"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "large"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangle"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "small"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangle"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "rect"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangleRefined"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "large"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangleRefined"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "small"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangleRefined"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "rect"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangleRefined2"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "large"] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "testTriangleRefined2"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "small"] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "testTriangleRefined2"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Name[@Image = "rect"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.java deleted file mode 100644 index 06c77ea661..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * BSD-style license; for more info see http://pmd.sourceforge.net/license.html - */ - -/** - * @see JEP 420: Pattern Matching for switch (Second Preview) - */ -public class ScopeOfPatternVariableDeclarations { - - - static void test(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(); - } - } - - - public static void main(String[] args) { - test('A'); - test2('\t'); - } -} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.txt deleted file mode 100644 index e2d6b63390..0000000000 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/ScopeOfPatternVariableDeclarations.txt +++ /dev/null @@ -1,241 +0,0 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @Default = false, @Final = false, @Image = "ScopeOfPatternVariableDeclarations", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = true] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledBlock[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- IfStatement[@Else = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | | +- Name[@Image = "c.charValue"] - | | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] - | | | +- Statement[] - | | | +- Block[@containsComment = false] - | | | +- BlockStatement[@Allocation = false] - | | | +- Statement[] - | | | +- StatementExpression[] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "System.out.println"] - | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | | +- ArgumentList[@Size = 1] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ding!\"", @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ding!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Character\"", @FloatLiteral = false, @Image = "\"Character\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Character\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledThrowStatement[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "IllegalStateException"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "IllegalStateException", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Invalid Integer argument of value \"", @FloatLiteral = false, @Image = "\"Invalid Integer argument of value \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Invalid Integer argument of value \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "i.intValue"] - | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- SwitchLabeledBlock[] - | +- SwitchLabel[@Default = true] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- BreakStatement[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 16, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabel[@Default = false] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- IfStatement[@Else = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "c.charValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] - | | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.print"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ding \"", @FloatLiteral = false, @Image = "\"Ding \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ding \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- IfStatement[@Else = false] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- EqualityExpression[@Image = "==", @Operator = "=="] - | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "c.charValue"] - | | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "9", @FloatLiteral = false, @Image = "9", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "9", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 9, @ValueAsLong = 9] - | | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.print"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Tab \"", @FloatLiteral = false, @Image = "\"Tab \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Tab \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"character\"", @FloatLiteral = false, @Image = "\"character\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"character\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabel[@Default = true] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'A\'", @FloatLiteral = false, @Image = "\'A\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'A\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "test2"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = true] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'\\t\'", @FloatLiteral = false, @Image = "\'\\t\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'\\t\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] From b07c5ae152a1a5b83d79e36eb49c7c3bcfc71d5a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 15:52:44 +0100 Subject: [PATCH 17/70] Remove old exclusions in all-java.xml --- pmd-core/src/main/resources/rulesets/internal/all-java.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pmd-core/src/main/resources/rulesets/internal/all-java.xml b/pmd-core/src/main/resources/rulesets/internal/all-java.xml index 796a9964d8..a8f260812f 100644 --- a/pmd-core/src/main/resources/rulesets/internal/all-java.xml +++ b/pmd-core/src/main/resources/rulesets/internal/all-java.xml @@ -26,12 +26,6 @@ .*/net/sourceforge/pmd/lang/java/ast/InfiniteLoopInLookahead.java - - .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/GuardedAndParenthesizedPatterns.java - .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java18p/RefiningPatternsInSwitch.java - From 1843ff51c790d5c9efd5839f41562785eb796e64 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 16:39:13 +0100 Subject: [PATCH 18/70] [java] Simplify null case label grammar Update DealingWithNull to that it compiles with java 20. Some cases are not allowed anymore. --- pmd-java/etc/grammar/Java.jjt | 13 +- .../java19p/DealingWithNull.txt | 48 +--- .../java19p/EnhancedTypeCheckingSwitch.txt | 6 +- .../GuardedAndParenthesizedPatterns.txt | 6 +- .../java19p/RefiningPatternsInSwitch.txt | 6 +- .../java20p/DealingWithNull.java | 29 +-- .../java20p/DealingWithNull.txt | 213 +++++++++--------- .../java20p/EnhancedTypeCheckingSwitch.txt | 6 +- .../GuardedAndParenthesizedPatterns.txt | 6 +- .../java20p/RefiningPatternsInSwitch.txt | 6 +- 10 files changed, 145 insertions(+), 194 deletions(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 47a3cf5ed1..3799e83425 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -2329,14 +2329,17 @@ void CaseLabelElement(ASTSwitchLabel label) #void: { "default" {label.setDefault(); checkForDefaultCaseLabel();} | + NullLiteral() {checkForNullCaseLabel();} + [ + // this lookahead is only required to allow parsing java-19-preview code + // since java-20-preview, combining null is only allowed with default + LOOKAHEAD(2) + "," "default" {label.setDefault(); checkForDefaultCaseLabel();} + ] + | LOOKAHEAD(Pattern()) Pattern() {checkForPatternMatchingInSwitch();} ( LOOKAHEAD({isKeyword("when")}) Guard() )* | ConditionalExpression() #Expression - { - if ("null".equals(((ASTExpression) jjtree.peekNode()).jjtGetFirstToken().getImage())) { - checkForNullCaseLabel(); - } - } } void Guard() #SwitchGuard: diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt index de92235cf5..cd76edcf71 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt @@ -22,11 +22,7 @@ | | +- Name[@Image = "s"] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] @@ -92,11 +88,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] + | | | +- NullLiteral[] | | | +- TypePattern[@ParenthesisDepth = 0] | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] @@ -150,11 +142,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] @@ -217,11 +205,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledThrowStatement[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "NullPointerException"] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] @@ -301,11 +285,7 @@ | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | | +- Name[@Image = "o"] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@ParenthesisDepth = 0] | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] @@ -354,11 +334,7 @@ | | | +- Name[@Image = "o"] | | +- SwitchLabeledExpression[] | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | | +- NullLiteral[] + | | | | +- NullLiteral[] | | | | +- TypePattern[@ParenthesisDepth = 0] | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] @@ -396,11 +372,7 @@ | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | | +- Name[@Image = "o"] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- SwitchLabel[@Default = true] | | +- BlockStatement[@Allocation = false] | | +- Statement[] @@ -424,11 +396,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledExpression[] | +- SwitchLabel[@Default = true] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] + | | +- NullLiteral[] | +- Expression[@StandAlonePrimitive = false] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt index 15082ceb4e..21d2bdb272 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt @@ -22,11 +22,7 @@ | | | +- Name[@Image = "o"] | | +- SwitchLabeledExpression[] | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] + | | | | +- NullLiteral[] | | | +- Expression[@StandAlonePrimitive = false] | | | +- PrimaryExpression[] | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt index 32b243ec05..20e1deb217 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt @@ -365,11 +365,7 @@ | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt index 74f5d9dc3e..2e3ee56846 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt @@ -73,11 +73,7 @@ | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Name[@Image = "s"] | +- SwitchLabel[@Default = false] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] + | | +- NullLiteral[] | +- BlockStatement[@Allocation = false] | | +- Statement[] | | +- BreakStatement[] 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 index 990fcc2522..69c05218b9 100644 --- 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 @@ -3,34 +3,33 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @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"); + case "Foo", "Bar" -> System.out.println("Great"); // CaseConstant default -> System.out.println("Ok"); } } static void testStringOrNull(Object o) { switch (o) { - case null, String s -> System.out.println("String: " + s); - case default -> System.out.print("default case"); + case String s -> System.out.println("String: " + s); // CasePattern + case null -> System.out.println("null"); + default -> System.out.println("default case"); } } - static void test(Object o) { + static void testStringOrDefaultNull(Object o) { switch (o) { - case null -> System.out.println("null!"); - case String s -> System.out.println("String"); - default -> System.out.println("Something else"); + 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(); @@ -43,8 +42,11 @@ public class DealingWithNull { static void test3(Object o) { switch(o) { - case null: case String s: - System.out.println("String, including null"); + 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"); @@ -52,7 +54,8 @@ public class DealingWithNull { } switch(o) { - case null, String s -> System.out.println("String, including null"); + case null -> System.out.println("null"); + case String s -> System.out.println("String"); default -> System.out.println("default case"); } @@ -68,7 +71,7 @@ public class DealingWithNull { } public static void main(String[] args) { - test("test"); + testStringOrDefaultNull("test"); test2(2); try { test2(null); diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt index de92235cf5..43b2513c7d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt @@ -22,11 +22,7 @@ | | +- Name[@Image = "s"] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] @@ -92,11 +88,73 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String: \"", @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null\"", @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = true] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testStringOrDefaultNull", @Modifiers = 16, @Name = "testStringOrDefaultNull", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testStringOrDefaultNull", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@ParenthesisDepth = 0] | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] @@ -119,73 +177,7 @@ | | +- Name[@Image = "s"] | +- SwitchLabeledExpression[] | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.print"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"default case\"", @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null!\"", @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] + | | +- NullLiteral[] | +- Expression[@StandAlonePrimitive = false] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] @@ -196,7 +188,7 @@ | +- Expression[@StandAlonePrimitive = false] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Something else\"", @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Something else\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null or default case\"", @FloatLiteral = false, @Image = "\"null or default case\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null or default case\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 16, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] | +- ResultType[@Void = true, @returnsArray = false] @@ -217,11 +209,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledThrowStatement[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- ThrowStatement[@FirstClassOrInterfaceTypeImage = "NullPointerException"] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] @@ -301,11 +289,23 @@ | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | | +- Name[@Image = "o"] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- StatementExpression[] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null\"", @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- BlockStatement[@Allocation = false] + | | | +- Statement[] + | | | +- BreakStatement[] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@ParenthesisDepth = 0] | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] @@ -324,7 +324,7 @@ | | | +- Expression[@StandAlonePrimitive = false] | | | +- PrimaryExpression[] | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | | +- BlockStatement[@Allocation = false] | | | +- Statement[] | | | +- BreakStatement[] @@ -354,11 +354,20 @@ | | | +- Name[@Image = "o"] | | +- SwitchLabeledExpression[] | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | | +- NullLiteral[] + | | | | +- NullLiteral[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "System.out.println"] + | | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | | +- ArgumentList[@Size = 1] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"null\"", @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- SwitchLabeledExpression[] + | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@ParenthesisDepth = 0] | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] @@ -374,7 +383,7 @@ | | | +- Expression[@StandAlonePrimitive = false] | | | +- PrimaryExpression[] | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String, including null\"", @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String, including null\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String\"", @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = true] | | +- Expression[@StandAlonePrimitive = false] @@ -396,11 +405,7 @@ | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | | +- Name[@Image = "o"] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- SwitchLabel[@Default = true] | | +- BlockStatement[@Allocation = false] | | +- Statement[] @@ -424,11 +429,7 @@ | | +- Name[@Image = "o"] | +- SwitchLabeledExpression[] | +- SwitchLabel[@Default = true] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] + | | +- NullLiteral[] | +- Expression[@StandAlonePrimitive = false] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] @@ -456,7 +457,7 @@ | +- StatementExpression[] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] + | | +- Name[@Image = "testStringOrDefaultNull"] | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] | +- Arguments[@ArgumentCount = 1, @Size = 1] | +- ArgumentList[@Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt index 15082ceb4e..21d2bdb272 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt @@ -22,11 +22,7 @@ | | | +- Name[@Image = "o"] | | +- SwitchLabeledExpression[] | | | +- SwitchLabel[@Default = false] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | | +- NullLiteral[] + | | | | +- NullLiteral[] | | | +- Expression[@StandAlonePrimitive = false] | | | +- PrimaryExpression[] | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt index 32b243ec05..20e1deb217 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt @@ -365,11 +365,7 @@ | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"double with parens\"", @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"double with parens\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] + | | | +- NullLiteral[] | | +- Expression[@StandAlonePrimitive = false] | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt index 74f5d9dc3e..2e3ee56846 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt @@ -73,11 +73,7 @@ | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Name[@Image = "s"] | +- SwitchLabel[@Default = false] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- NullLiteral[] + | | +- NullLiteral[] | +- BlockStatement[@Allocation = false] | | +- Statement[] | | +- BreakStatement[] From 36fb459bd921da69bbfd67e2e2b58a6115fea98a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 17:09:58 +0100 Subject: [PATCH 19/70] [java] Correct grammar regarding default case label Update ExhaustiveSwitch so that it compiles with java 20. "case default" is not allowed anymore. --- .../resources/rulesets/internal/all-java.xml | 4 + pmd-java/etc/grammar/Java.jjt | 12 +- .../java20p/EnhancedTypeCheckingSwitch.java | 14 +- .../java20p/EnhancedTypeCheckingSwitch.txt | 123 +++++++++++++++++- .../java20p/ExhaustiveSwitch.java | 12 +- .../java20p/ExhaustiveSwitch.txt | 52 -------- 6 files changed, 149 insertions(+), 68 deletions(-) diff --git a/pmd-core/src/main/resources/rulesets/internal/all-java.xml b/pmd-core/src/main/resources/rulesets/internal/all-java.xml index a8f260812f..0f587e1d9e 100644 --- a/pmd-core/src/main/resources/rulesets/internal/all-java.xml +++ b/pmd-core/src/main/resources/rulesets/internal/all-java.xml @@ -26,6 +26,10 @@ .*/net/sourceforge/pmd/lang/java/ast/InfiniteLoopInLookahead.java + + .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.java + .*/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.java + diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 3799e83425..55eb2b6ea1 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -558,8 +558,14 @@ public class JavaParser { } private void checkForDefaultCaseLabel() { + if (!((jdkVersion == 19) && preview)) { + throwParseException("Default case labels in switch are only supported with JDK 19 Preview."); + } + } + + private void checkForNullWithDefaultCaseLabel() { if (!isJEP406Supported()) { - throwParseException("Default case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview."); + throwParseException("Null case labels with default in switch are only supported with JDK 19 Preview or JDK 20 Preview."); } } @@ -2327,14 +2333,14 @@ void SwitchLabel() : void CaseLabelElement(ASTSwitchLabel label) #void: {} { - "default" {label.setDefault(); checkForDefaultCaseLabel();} + "default" {label.setDefault(); checkForDefaultCaseLabel();} // only valid in java-19-preview | NullLiteral() {checkForNullCaseLabel();} [ // this lookahead is only required to allow parsing java-19-preview code // since java-20-preview, combining null is only allowed with default LOOKAHEAD(2) - "," "default" {label.setDefault(); checkForDefaultCaseLabel();} + "," "default" {label.setDefault(); checkForNullWithDefaultCaseLabel();} ] | LOOKAHEAD(Pattern()) Pattern() {checkForPatternMatchingInSwitch();} ( LOOKAHEAD({isKeyword("when")}) Guard() )* 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 index ad8fe31898..ed3951e62e 100644 --- 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 @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) */ public class EnhancedTypeCheckingSwitch { @@ -14,7 +14,7 @@ public class EnhancedTypeCheckingSwitch { 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); + case int[] ia -> System.out.println("Array of ints of length " + ia.length); default -> System.out.println("Something else"); } } @@ -22,6 +22,16 @@ public class EnhancedTypeCheckingSwitch { 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); } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt index 21d2bdb272..bc3316ffea 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt @@ -122,7 +122,7 @@ | | | +- AdditiveExpression[@Image = "+", @Operator = "+"] | | | +- PrimaryExpression[] | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Array of ints of length\"", @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Array of ints of length\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Array of ints of length \"", @FloatLiteral = false, @Image = "\"Array of ints of length \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Array of ints of length \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | | | +- PrimaryExpression[] | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | | +- Name[@Image = "ia.length"] @@ -163,6 +163,127 @@ | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"test\"", @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"test\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "typeTester"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "typeTester"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "Color.BLUE"] + | +- BlockStatement[@Allocation = true] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- AssignmentOperator[@Compound = false, @Image = "="] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- ArrayDimsAndInits[@Array = true, @ArrayDepth = 1] + | | +- ArrayInitializer[] + | | +- VariableInitializer[] + | | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- VariableInitializer[] + | | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- VariableInitializer[] + | | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "4", @FloatLiteral = false, @Image = "4", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "4", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 4, @ValueAsLong = 4] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "typeTester"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- BlockStatement[@Allocation = true] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- AssignmentOperator[@Compound = false, @Image = "="] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "8", @FloatLiteral = false, @Image = "8", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "8", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 8, @ValueAsLong = 8] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "typeTester"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "o"] + | +- BlockStatement[@Allocation = true] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "o"] + | | +- AssignmentOperator[@Compound = false, @Image = "="] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- BlockStatement[@Allocation = false] | +- Statement[] | +- StatementExpression[] | +- PrimaryExpression[] 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 index 44b5bb9fa7..3918654e57 100644 --- 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 @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) */ public class ExhaustiveSwitch { @@ -15,14 +15,6 @@ public class ExhaustiveSwitch { }; } - static int coverageDefaultCase(Object o) { - return switch (o) { - case String s -> s.length(); - case Integer i -> i; - case default -> 0; - }; - } - static void coverageStatement(Object o) { switch (o) { case String s: @@ -92,4 +84,4 @@ public class ExhaustiveSwitch { System.out.println("F:" + testGenericSealedExhaustive(new F())); } -} \ No newline at end of file +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt index 3c62b1a3e2..99203d9819 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt @@ -55,58 +55,6 @@ | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "0", @FloatLiteral = false, @Image = "0", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "0", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverageDefaultCase", @Modifiers = 16, @Name = "coverageDefaultCase", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | +- MethodDeclarator[@Image = "coverageDefaultCase", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- SwitchExpression[] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "o"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "s.length"] - | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Integer"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Integer", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "i"] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = true] - | +- Expression[@StandAlonePrimitive = true] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "0", @FloatLiteral = false, @Image = "0", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "0", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "coverageStatement", @Modifiers = 16, @Name = "coverageStatement", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] | +- ResultType[@Void = true, @returnsArray = false] | +- MethodDeclarator[@Image = "coverageStatement", @ParameterCount = 1] From 50cdb99a7f71bed8dffa0c3f32fea4b9e1cbd888 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 18:49:50 +0100 Subject: [PATCH 20/70] [java] Update sample files for Pattern Matching for switch --- .../pmd/lang/java/ast/ASTSwitchGuard.java | 3 +- .../pmd/lang/java/ast/ASTSwitchLabel.java | 7 + .../GuardedAndParenthesizedPatterns.java | 38 ++++-- .../GuardedAndParenthesizedPatterns.txt | 99 ++++++++++++++- .../java20p/PatternsInSwitchLabels.java | 2 +- .../java20p/RefiningPatternsInSwitch.java | 12 +- .../java20p/RefiningPatternsInSwitch.txt | 14 ++ .../ScopeOfPatternVariableDeclarations.java | 24 +++- .../ScopeOfPatternVariableDeclarations.txt | 120 +++++++++++++++++- 9 files changed, 288 insertions(+), 31 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java index b59332f2a1..e801d12785 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchGuard.java @@ -8,6 +8,7 @@ import net.sourceforge.pmd.annotation.Experimental; /** * A guard for refining a switch case in {@link ASTSwitchLabel}s. + * This is a Java 19 Preview and Java 20 Preview language feature. * *
  *
@@ -16,7 +17,7 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) */ @Experimental public final class ASTSwitchGuard extends AbstractJavaNode { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java index 3c795af045..1d094a44ce 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java @@ -14,9 +14,16 @@ import net.sourceforge.pmd.annotation.InternalApi; *
  *
  * SwitchLabel ::=  "case" {@linkplain ASTExpression Expression} ":"
+ *                | "case" "null [ "," "default" ] ":"
+ *                | "case" ( {@linkplain ASTTypePattern TypePattern} | {@linkplain ASTRecordPattern RecordPattern} ) ":"
  *                | "default" ":"
  *
  * 
+ * + *

Note: case null and the case patterns are a Java 19 Preview and Java 20 Preview language feature

+ * + * @see JEP 433: Pattern Matching for switch (Fourth Preview) + * @see JEP 405: Record Patterns (Preview) */ public class ASTSwitchLabel extends AbstractJavaNode { 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 index 2dd7da3f70..41e2a343fe 100644 --- 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 @@ -3,28 +3,28 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @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 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"); + 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 + // 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 + // verify that "when" can still be used as an identifier -> local variable void testIdentifierWhen() { int when = 1; System.out.println(when); @@ -35,13 +35,13 @@ public class GuardedAndParenthesizedPatterns { 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 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"); + case (((Double d))) -> System.out.println("double with parens"); + case null -> System.out.println("null!"); + default -> System.out.println("default case"); } } @@ -64,6 +64,14 @@ public class GuardedAndParenthesizedPatterns { } } + 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"); @@ -76,5 +84,7 @@ public class GuardedAndParenthesizedPatterns { 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 index 20e1deb217..30a0397834 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt @@ -533,6 +533,73 @@ | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"A string containing at least four characters\"", @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"A string containing at least four characters\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testScopeOfPatternVariableDeclarations", @Modifiers = 16, @Name = "testScopeOfPatternVariableDeclarations", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testScopeOfPatternVariableDeclarations", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "obj"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- ConditionalAndExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- InstanceOfExpression[] + | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "obj"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- RelationalExpression[@Image = ">"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "s.length"] + | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "3", @FloatLiteral = false, @Image = "3", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "3", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "s"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Not a string\"", @FloatLiteral = false, @Image = "\"Not a string\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Not a string\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] +- ResultType[@Void = true, @returnsArray = false] @@ -642,17 +709,43 @@ | | +- Name[@Image = "e.printStackTrace"] | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] | +- Arguments[@ArgumentCount = 0, @Size = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testWithNull"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testScopeOfPatternVariableDeclarations"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- BlockStatement[@Allocation = false] +- Statement[] +- StatementExpression[] +- PrimaryExpression[] +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "testWithNull"] + | +- Name[@Image = "testScopeOfPatternVariableDeclarations"] +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] +- Arguments[@ArgumentCount = 1, @Size = 1] +- ArgumentList[@Size = 1] +- Expression[@StandAlonePrimitive = false] +- PrimaryExpression[] +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- NullLiteral[] + +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"long enough\"", @FloatLiteral = false, @Image = "\"long enough\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"long enough\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] 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 index a3ed038cb2..210c03f066 100644 --- 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 @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) */ public class PatternsInSwitchLabels { 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 index 7cbd63a4b6..c2eadc6711 100644 --- 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 @@ -3,7 +3,7 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) */ public class RefiningPatternsInSwitch { @@ -33,7 +33,10 @@ public class RefiningPatternsInSwitch { static void testTriangleRefined(Shape s) { switch (s) { - case Triangle t when t.calculateArea() > 100 -> + 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"); @@ -42,7 +45,10 @@ public class RefiningPatternsInSwitch { static void testTriangleRefined2(Shape s) { switch (s) { - case Triangle t when t.calculateArea() > 100 -> + case null -> + { break; } + case Triangle t + when t.calculateArea() > 100 -> System.out.println("Large triangle"); case Triangle t -> System.out.println("Small triangle"); diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt index 2e3ee56846..71eeb8ee93 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt @@ -146,6 +146,13 @@ | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Name[@Image = "s"] + | +- SwitchLabeledBlock[] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@ParenthesisDepth = 0] @@ -206,6 +213,13 @@ | | +- PrimaryExpression[] | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Name[@Image = "s"] + | +- SwitchLabeledBlock[] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] | +- SwitchLabeledExpression[] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@ParenthesisDepth = 0] 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 index 471f1b1074..d65340e4da 100644 --- 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 @@ -3,12 +3,22 @@ */ /** - * @see JEP 427: Pattern Matching for switch (Third Preview) + * @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 test(Object o) { + static void testSwitchRule(Object o) { switch (o) { case Character c -> { if (c.charValue() == 7) { @@ -36,13 +46,19 @@ public class ScopeOfPatternVariableDeclarations { } System.out.println("character"); default: - System.out.println(); + System.out.println("fall-through"); } } public static void main(String[] args) { - test('A'); + 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 index e2d6b63390..2754f87060 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt @@ -3,9 +3,64 @@ +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @Default = false, @Final = false, @Image = "ScopeOfPatternVariableDeclarations", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testSwitchBlock", @Modifiers = 16, @Name = "testSwitchBlock", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test", @ParameterCount = 1] + | +- MethodDeclarator[@Image = "testSwitchBlock", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "obj"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "obj"] + | +- SwitchLabel[@Default = false] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Character"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Character", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- SwitchGuard[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- EqualityExpression[@Image = "==", @Operator = "=="] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "c.charValue"] + | | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + | | | +- Arguments[@ArgumentCount = 0, @Size = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "7", @FloatLiteral = false, @Image = "7", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "7", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 7, @ValueAsLong = 7] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Ding!\"", @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Ding!\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- BreakStatement[] + | +- SwitchLabel[@Default = true] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- BreakStatement[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "testSwitchRule", @Modifiers = 16, @Name = "testSwitchRule", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "testSwitchRule", @ParameterCount = 1] | | +- FormalParameters[@ParameterCount = 1, @Size = 1] | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] @@ -200,8 +255,13 @@ | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"fall-through\"", @FloatLiteral = false, @Image = "\"fall-through\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"fall-through\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] +- ResultType[@Void = true, @returnsArray = false] @@ -218,7 +278,20 @@ | +- StatementExpression[] | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "test"] + | | +- Name[@Image = "testSwitchBlock"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = true] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'\\u0007\'", @FloatLiteral = false, @Image = "\'\u0007\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'\u0007\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "testSwitchRule"] | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] | +- Arguments[@ArgumentCount = 1, @Size = 1] | +- ArgumentList[@Size = 1] @@ -226,6 +299,43 @@ | +- PrimaryExpression[] | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Literal[@CharLiteral = true, @DoubleLiteral = false, @EscapedStringLiteral = "\'A\'", @FloatLiteral = false, @Image = "\'A\'", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "\'A\'", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- TryStatement[@Finally = false, @TryWithResources = false] + | +- Block[@containsComment = true] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "testSwitchRule"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] + | +- CatchStatement[@ExceptionName = "e", @MulticatchStatement = false] + | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "IllegalStateException"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "IllegalStateException", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = true, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "e"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "e"] +- BlockStatement[@Allocation = false] +- Statement[] +- StatementExpression[] From 600ad870db8e06ad7c328b61f48cdf2a4f434c45 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 19:37:28 +0100 Subject: [PATCH 21/70] [java] Support record patterns in for-each loops --- pmd-java/etc/grammar/Java.jjt | 26 +- .../java/ast/ASTComponentPatternList.java | 5 +- .../pmd/lang/java/ast/ASTForStatement.java | 6 +- .../pmd/lang/java/ast/ASTRecordPattern.java | 5 +- .../pmd/lang/java/ast/ASTSwitchLabel.java | 2 +- .../java/ast/Java20PreviewTreeDumpTest.java | 17 + .../java20p/RecordPatterns.java | 44 +- .../java20p/RecordPatterns.txt | 416 +++++++++++++++++- .../java20p/RecordPatternsInEnhancedFor.java | 27 ++ .../java20p/RecordPatternsInEnhancedFor.txt | 166 +++++++ 10 files changed, 687 insertions(+), 27 deletions(-) create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 55eb2b6ea1..475546acce 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -1,4 +1,12 @@ /** + * Support "JEP 433: Pattern Matching for switch (Fourth Preview)" for Java 20 Preview + * SwitchLabel simplified + * Support "JEP 432: Record Patterns (Second Preview)" for Java 20 Preview + * ForStatement allows record patterns + * Remove support for Java 18 preview language features + * GuardedPattern is removed + * Andreas Dangel 02/2023 + *==================================================================== * Support "JEP 427: Pattern Matching for switch (Third Preview)" for Java 19 Preview * Note: GuardedPattern is deprecated and only valid for 17-preview and 18-preview * New AST node: ASTSwitchGuard (production "Guard") - used within switch case labels for refining a pattern @@ -587,6 +595,12 @@ public class JavaParser { } } + private void checkForRecordPatternsEnhancedFor() { + if (!((jdkVersion == 20) && preview)) { + throwParseException("Record Patterns in enhanced for statements are only supported with JDK 20 Preview."); + } + } + // This is a semantic LOOKAHEAD to determine if we're dealing with an assert // Note that this can't be replaced with a syntactic lookahead // since "assert" isn't a string literal token @@ -2397,9 +2411,8 @@ void ForStatement() : { "for" "(" ( - LOOKAHEAD(LocalVariableDeclaration() ":") - {checkForBadJDK15ForLoopSyntaxArgumentsUsage();} - LocalVariableDeclaration() ":" Expression() + LOOKAHEAD(EnhancedForDeclaration() ":") + EnhancedForDeclaration() ":" Expression() | [ ForInit() ] ";" [ Expression() ] ";" @@ -2408,6 +2421,13 @@ void ForStatement() : ")" Statement() } +void EnhancedForDeclaration() #void: +{checkForBadJDK15ForLoopSyntaxArgumentsUsage();} +{ + LOOKAHEAD(LocalVariableDeclaration()) LocalVariableDeclaration() + | {checkForRecordPatternsEnhancedFor();} RecordPattern() +} + void ForInit() : {} { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java index 6fded4c6ab..fdf010dc66 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTComponentPatternList.java @@ -8,7 +8,8 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * Contains a potentially empty list of nested Patterns for {@linkplain ASTRecordPattern RecordPattern} (JDK 19). + * Contains a potentially empty list of nested Patterns for {@linkplain ASTRecordPattern RecordPattern} + * (Java 19 Preview and Java 20 Preview). * *
  *
@@ -16,7 +17,7 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 405: Record Patterns (Preview) + * @see JEP 432: Record Patterns (Second Preview) */ @Experimental public final class ASTComponentPatternList extends AbstractJavaNode { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForStatement.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForStatement.java index 5ba470d579..7d03c82a27 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForStatement.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForStatement.java @@ -11,10 +11,14 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * ForStatement ::= "for" "(" {@linkplain ASTLocalVariableDeclaration LocalVariableDeclaration} ":" {@linkplain ASTExpression Expression} ")" {@linkplain ASTStatement Statement}
+ * ForStatement ::= "for" "(" ( {@linkplain ASTLocalVariableDeclaration LocalVariableDeclaration} | {@linkplain ASTRecordPattern RecordPattern} ) ":" {@linkplain ASTExpression Expression} ")" {@linkplain ASTStatement Statement}
  *                | "for" "(" {@linkplain ASTForInit ForInit}? ";" {@linkplain ASTExpression Expression}? ";" {@linkplain ASTForUpdate ForUpdate}? ")" {@linkplain ASTStatement Statement}
  *
  * 
+ * + *

Note: Using a {@linkplain ASTRecordPattern RecordPattern} in an enhanced for statement is a Java 20 Preview feature

+ * + * @see JEP 432: Record Patterns (Second Preview) */ // TODO this should be split into two different nodes, otherwise // we can't enrich the API without returning null half the time 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 6db0e82d6b..c565971dab 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 @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * A record pattern (JDK19). + * A record pattern (Java 19 Preview and Java 20 Preview). * *
  *
@@ -15,7 +15,8 @@ import net.sourceforge.pmd.annotation.Experimental;
  *
  * 
* - * @see JEP 405: Record Patterns (Preview) + * @see ASTRecordDeclaration + * @see JEP 432: Record Patterns (Second Preview) */ @Experimental public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java index 1d094a44ce..32c70c278b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchLabel.java @@ -23,7 +23,7 @@ import net.sourceforge.pmd.annotation.InternalApi; *

Note: case null and the case patterns are a Java 19 Preview and Java 20 Preview language feature

* * @see JEP 433: Pattern Matching for switch (Fourth Preview) - * @see JEP 405: Record Patterns (Preview) + * @see JEP 432: Record Patterns (Second Preview) */ public class ASTSwitchLabel extends AbstractJavaNode { 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 index 7cf4746d64..cc25712867 100644 --- 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 @@ -118,4 +118,21 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { assertTrue("Unexpected message: " + thrown.getMessage(), thrown.getMessage().contains("Record Patterns are only supported with JDK 19 Preview or JDK 20 Preview.")); } + + @Test + public void recordPatternsInEnhancedFor() { + doTest("RecordPatternsInEnhancedFor"); + } + + @Test + public void recordPatternsInEnhancedForBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { + @Override + public void run() throws Throwable { + java20.parseResource("RecordPatternsInEnhancedFor.java"); + } + }); + assertTrue("Unexpected message: " + thrown.getMessage(), + thrown.getMessage().contains("Record Patterns in enhanced for statements are only supported with JDK 20 Preview.")); + } } 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 index 4a28b35b50..2ae278af1e 100644 --- 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 @@ -3,7 +3,7 @@ */ /** - * @see JEP 405: Record Patterns (Preview) + * @see JEP 432: Record Patterns (Second Preview) */ public class RecordPatterns { @@ -41,6 +41,12 @@ public class RecordPatterns { } } + 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), @@ -49,16 +55,46 @@ public class RecordPatterns { } } + 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 test1(Box bo) { + void test1a(Box bo) { if (bo instanceof Box(String s)) { System.out.println("String " + s); } } - void test2(Box bo) { + void test1(Box bo) { if (bo instanceof Box(var s)) { System.out.println("String " + s); } } -} \ No newline at end of file + + // 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 index 1141e09861..34715ff83d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt @@ -275,6 +275,115 @@ | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Name[@Image = "c"] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 6, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "createRectangle", @Modifiers = 0, @Name = "createRectangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] + | +- ResultType[@Void = false, @returnsArray = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | +- MethodDeclarator[@Image = "createRectangle", @ParameterCount = 6] + | | +- FormalParameters[@ParameterCount = 6, @Size = 6] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x1", @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x1"] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y1", @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y1"] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c1", @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c1"] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x2", @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x2"] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y2", @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y2"] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c2", @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c2"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = true] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "r", @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- AllocationExpression[@AnonymousClass = false] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | | +- ArgumentList[@Size = 2] + | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- AllocationExpression[@AnonymousClass = false] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | | | +- ArgumentList[@Size = 2] + | | | | +- Expression[@StandAlonePrimitive = false] + | | | | | +- PrimaryExpression[] + | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | | +- Name[@Image = "x1"] + | | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "y1"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "c1"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- AllocationExpression[@AnonymousClass = false] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | | +- ArgumentList[@Size = 2] + | | | +- Expression[@StandAlonePrimitive = false] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Name[@Image = "x2"] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "y2"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "c2"] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ReturnStatement[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "r"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Modifiers = 0, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] | +- ResultType[@Void = true, @returnsArray = false] | +- MethodDeclarator[@Image = "printXCoordOfUpperLeftPointWithPatterns", @ParameterCount = 1] @@ -345,6 +454,108 @@ | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Name[@Image = "x"] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "nestedPatternsCanFailToMatch", @Modifiers = 0, @Name = "nestedPatternsCanFailToMatch", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "nestedPatternsCanFailToMatch", @ParameterCount = 0] + | | +- FormalParameters[@ParameterCount = 0, @Size = 0] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = true] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- Expression[@StandAlonePrimitive = true] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = true] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "p"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] + | +- Statement[] + | | +- Block[@containsComment = false] + | | +- BlockStatement[@Allocation = false] + | | +- Statement[] + | | +- StatementExpression[] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "s"] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\", \"", @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\", \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "t"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Not a pair of strings\"", @FloatLiteral = false, @Image = "\"Not a pair of strings\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Not a pair of strings\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Box", @Default = false, @Final = true, @Image = "Box", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Box", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] | +- TypeParameters[] | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] @@ -356,9 +567,9 @@ | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] | +- RecordBody[] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1", @Modifiers = 0, @Name = "test1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1a", @Modifiers = 0, @Name = "test1a", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test1", @ParameterCount = 1] + | +- MethodDeclarator[@Image = "test1a", @ParameterCount = 1] | | +- FormalParameters[@ParameterCount = 1, @Size = 1] | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] @@ -411,9 +622,182 @@ | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Name[@Image = "s"] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 0, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1", @Modifiers = 0, @Name = "test1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test1", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "bo"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "s"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 0, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "bo"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "s"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test3", @Modifiers = 0, @Name = "test3", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "test3", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- IfStatement[@Else = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- InstanceOfExpression[] + | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "bo"] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "s"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test4", @Modifiers = 0, @Name = "test4", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] + +- MethodDeclarator[@Image = "test4", @ParameterCount = 1] | +- FormalParameters[@ParameterCount = 1, @Size = 1] | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] @@ -422,7 +806,11 @@ | | +- TypeArguments[@Diamond = false] | | +- TypeArgument[@Wildcard = false] | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] +- Block[@containsComment = false] +- BlockStatement[@Allocation = false] @@ -436,16 +824,16 @@ | +- RecordPattern[@ParenthesisDepth = 0] | +- ReferenceType[@Array = false, @ArrayDepth = 0] | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] | +- ComponentPatternList[] - | +- TypePattern[@ParenthesisDepth = 0] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] + | +- ComponentPatternList[] + | +- TypePattern[@ParenthesisDepth = 0] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] +- Statement[] +- Block[@containsComment = false] +- BlockStatement[@Allocation = 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 new file mode 100644 index 0000000000..91e77aa3e1 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.java @@ -0,0 +1,27 @@ +/* + * 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); + } + } +} 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 new file mode 100644 index 0000000000..9288395a9f --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt @@ -0,0 +1,166 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor", @Default = false, @Final = false, @Image = "RecordPatternsInEnhancedFor", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] + | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.ENUM] + | +- EnumDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] + | +- EnumBody[] + | +- EnumConstant[@AnonymousClass = false, @Image = "RED"] + | +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] + | +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @Default = false, @Final = true, @Image = "ColoredPoint", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "ColoredPoint", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Rectangle", @Default = false, @Final = true, @Image = "Rectangle", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Rectangle", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "upperLeft"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lowerRight"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "dump", @Modifiers = 16, @Name = "dump", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "dump", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Point"] + | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "pointArray", @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "pointArray"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ForStatement[@Foreach = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "pointArray"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"(\"", @FloatLiteral = false, @Image = "\"(\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"(\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "x"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\", \"", @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\", \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "y"] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\")\"", @FloatLiteral = false, @Image = "\")\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\")\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColors", @Modifiers = 16, @Name = "printUpperLeftColors", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "printUpperLeftColors", @ParameterCount = 1] + | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Rectangle"] + | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- ForStatement[@Foreach = false] + +- RecordPattern[@ParenthesisDepth = 0] + | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | +- ComponentPatternList[] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- TypePattern[@ParenthesisDepth = 0] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] + +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "r"] + +- Statement[] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "System.out.println"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Name[@Image = "c"] From 4ec06b71fe33fa0233af3759071cbd73b9af09c5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 19:48:12 +0100 Subject: [PATCH 22/70] [java] Add more examples for record patterns --- .../java/ast/Java20PreviewTreeDumpTest.java | 5 + .../RecordPatternsExhaustiveSwitch.java | 37 ++ .../RecordPatternsExhaustiveSwitch.txt | 353 ++++++++++++++++++ .../java20p/RecordPatternsInEnhancedFor.java | 16 + .../java20p/RecordPatternsInEnhancedFor.txt | 231 +++++++++--- 5 files changed, 594 insertions(+), 48 deletions(-) create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt 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 index cc25712867..9c2926d64f 100644 --- 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 @@ -135,4 +135,9 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { assertTrue("Unexpected message: " + thrown.getMessage(), thrown.getMessage().contains("Record Patterns in enhanced for statements are only supported with JDK 20 Preview.")); } + + @Test + public void recordPatternsExhaustiveSwitch() { + doTest("RecordPatternsExhaustiveSwitch"); + } } 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 new file mode 100644 index 0000000000..7fb9f1250e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.java @@ -0,0 +1,37 @@ +/* + * 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 new file mode 100644 index 0000000000..a12d5b9ee9 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt @@ -0,0 +1,353 @@ ++- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] + +- TypeDeclaration[] + +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @Default = false, @Final = false, @Image = "RecordPatternsExhaustiveSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @Default = false, @Final = false, @Image = "A", @Interface = false, @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "A", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @Default = false, @Final = false, @Image = "B", @Interface = false, @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "B", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ExtendsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @Default = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "I", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] + | +- PermitsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @Default = false, @Final = true, @Image = "C", @Interface = false, @Local = false, @Modifiers = 32, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] + | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @Default = false, @Final = true, @Image = "D", @Interface = false, @Local = false, @Modifiers = 32, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "D", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] + | +- ImplementsList[] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- TypeParameters[] + | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + +- ResultType[@Void = true, @returnsArray = false] + +- MethodDeclarator[@Image = "test", @ParameterCount = 0] + | +- FormalParameters[@ParameterCount = 0, @Size = 0] + +- Block[@containsComment = false] + +- BlockStatement[@Allocation = false] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p1", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclarator[@Initializer = true, @Name = "p1"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p1", @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p1"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p2", @Volatile = false] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclarator[@Initializer = true, @Name = "p2"] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p2", @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p2"] + | +- VariableInitializer[] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- NullLiteral[] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "p1"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | | +- TypeArguments[@Diamond = false] + | | | | +- TypeArgument[@Wildcard = false] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- ComponentPatternList[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | | +- TypeArguments[@Diamond = false] + | | | | +- TypeArgument[@Wildcard = false] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- ComponentPatternList[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a1", @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a1"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a2", @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a2"] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"exhaustive now\"", @FloatLiteral = false, @Image = "\"exhaustive now\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"exhaustive now\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "p2"] + | +- SwitchLabeledExpression[] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | | +- TypeArguments[@Diamond = false] + | | | | +- TypeArgument[@Wildcard = false] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | | +- ComponentPatternList[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Name[@Image = "System.out.println"] + | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | | +- Arguments[@ArgumentCount = 1, @Size = 1] + | | +- ArgumentList[@Size = 1] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- BlockStatement[@Allocation = false] + +- Statement[] + +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "p2"] + +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- SwitchLabeledExpression[] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | +- TypeArguments[@Diamond = false] + | | | +- TypeArgument[@Wildcard = false] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + +- SwitchLabeledExpression[] + +- SwitchLabel[@Default = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- TypeArguments[@Diamond = false] + | | +- TypeArgument[@Wildcard = false] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] + | +- ComponentPatternList[] + | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d1", @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d1"] + | +- TypePattern[@ParenthesisDepth = 0] + | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d2", @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d2"] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "System.out.println"] + +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 1, @Size = 1] + +- ArgumentList[@Size = 1] + +- Expression[@StandAlonePrimitive = false] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] 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 index 91e77aa3e1..0f3b5f2274 100644 --- 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 @@ -24,4 +24,20 @@ public class RecordPatternsInEnhancedFor { 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 index 9288395a9f..7cb634b3ae 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt @@ -109,58 +109,193 @@ | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\")\"", @FloatLiteral = false, @Image = "\")\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\")\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColors", @Modifiers = 16, @Name = "printUpperLeftColors", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColors", @Modifiers = 16, @Name = "printUpperLeftColors", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "printUpperLeftColors", @ParameterCount = 1] + | | +- FormalParameters[@ParameterCount = 1, @Size = 1] + | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] + | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Rectangle"] + | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ForStatement[@Foreach = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | | +- ComponentPatternList[] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] + | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] + | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] + | | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "r"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "c"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] + | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] + | +- RecordComponentList[@Size = 2] + | | +- RecordComponent[@Varargs = false] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "fst", @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "fst"] + | | +- RecordComponent[@Varargs = false] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "snd", @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "snd"] + | +- RecordBody[] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "exceptionTest", @Modifiers = 16, @Name = "exceptionTest", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] + | +- ResultType[@Void = true, @returnsArray = false] + | +- MethodDeclarator[@Image = "exceptionTest", @ParameterCount = 0] + | | +- FormalParameters[@ParameterCount = 0, @Size = 0] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = true] + | | +- LocalVariableDeclaration[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "ps", @Volatile = false] + | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Pair"] + | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "ps"] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ps", @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ps"] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- ArrayDimsAndInits[@Array = true, @ArrayDepth = 1] + | | +- ArrayInitializer[] + | | +- VariableInitializer[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- AllocationExpression[@AnonymousClass = false] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | | +- ArgumentList[@Size = 2] + | | | +- Expression[@StandAlonePrimitive = true] + | | | | +- PrimaryExpression[] + | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- Expression[@StandAlonePrimitive = true] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- VariableInitializer[] + | | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | | +- NullLiteral[] + | | +- VariableInitializer[] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- AllocationExpression[@AnonymousClass = false] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- Arguments[@ArgumentCount = 2, @Size = 2] + | | +- ArgumentList[@Size = 2] + | | +- Expression[@StandAlonePrimitive = false] + | | | +- PrimaryExpression[] + | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"hello\"", @FloatLiteral = false, @Image = "\"hello\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"hello\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"world\"", @FloatLiteral = false, @Image = "\"world\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"world\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- ForStatement[@Foreach = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] + | | +- ComponentPatternList[] + | | +- TypePattern[@ParenthesisDepth = 0] + | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "f", @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "f"] + | | +- TypePattern[@ParenthesisDepth = 0] + | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] + | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] + | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] + | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] + | +- Expression[@StandAlonePrimitive = false] + | | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "ps"] + | +- Statement[] + | +- Block[@containsComment = false] + | +- BlockStatement[@Allocation = false] + | +- Statement[] + | +- StatementExpression[] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "System.out.println"] + | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] + | +- Arguments[@ArgumentCount = 1, @Size = 1] + | +- ArgumentList[@Size = 1] + | +- Expression[@StandAlonePrimitive = false] + | +- AdditiveExpression[@Image = "+", @Operator = "+"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Name[@Image = "f"] + | +- PrimaryExpression[] + | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\" -> \"", @FloatLiteral = false, @Image = "\" -> \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\" -> \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] + | +- PrimaryExpression[] + | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "s"] + +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "printUpperLeftColors", @ParameterCount = 1] + +- MethodDeclarator[@Image = "main", @ParameterCount = 1] | +- FormalParameters[@ParameterCount = 1, @Size = 1] | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Rectangle"] + | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] + | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] + | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] +- Block[@containsComment = false] +- BlockStatement[@Allocation = false] +- Statement[] - +- ForStatement[@Foreach = false] - +- RecordPattern[@ParenthesisDepth = 0] - | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | +- ComponentPatternList[] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- TypePattern[@ParenthesisDepth = 0] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] - +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "r"] - +- Statement[] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "System.out.println"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Name[@Image = "c"] + +- StatementExpression[] + +- PrimaryExpression[] + +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] + | +- Name[@Image = "exceptionTest"] + +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] + +- Arguments[@ArgumentCount = 0, @Size = 0] From 3ac021da02fec700d5dd8aac44d38fb65f59457f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 19:54:19 +0100 Subject: [PATCH 23/70] [java] Remove support for named record patterns --- pmd-java/etc/grammar/Java.jjt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index 475546acce..f1e87b3ce3 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -3,6 +3,7 @@ * SwitchLabel simplified * Support "JEP 432: Record Patterns (Second Preview)" for Java 20 Preview * ForStatement allows record patterns + * Removed named record patterns (optional VariableDeclaratorId following the pattern) * Remove support for Java 18 preview language features * GuardedPattern is removed * Andreas Dangel 02/2023 @@ -1838,7 +1839,7 @@ void TypePattern(): void RecordPattern(): { checkForRecordPatterns(); } { - (Annotation())* ReferenceType() RecordStructurePattern() [ VariableDeclaratorId() ] + (Annotation())* ReferenceType() RecordStructurePattern() } void RecordStructurePattern() #ComponentPatternList: From e80e4cf204cce79e910e74ed4f1efc3db885bba3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 20:03:32 +0100 Subject: [PATCH 24/70] [java] Fix javadoc warnings --- .../net/sourceforge/pmd/lang/java/ast/ASTAndExpression.java | 2 +- .../pmd/lang/java/ast/ASTAnyTypeBodyDeclaration.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTAssignmentOperator.java | 4 ++-- .../pmd/lang/java/ast/ASTConditionalAndExpression.java | 2 +- .../pmd/lang/java/ast/ASTRelationalExpression.java | 2 +- .../net/sourceforge/pmd/lang/java/ast/ASTShiftExpression.java | 4 ++-- .../net/sourceforge/pmd/lang/java/ast/ASTTypeArguments.java | 4 ++-- .../java/net/sourceforge/pmd/lang/java/ast/ASTTypeBound.java | 2 +- .../net/sourceforge/pmd/lang/java/ast/ASTTypeParameters.java | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAndExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAndExpression.java index da11a08327..c876f53034 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAndExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAndExpression.java @@ -17,7 +17,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * AndExpression ::=  {@linkplain ASTEqualityExpression EqualityExpression} ( "&" {@linkplain ASTEqualityExpression EqualityExpression} )+
+ * AndExpression ::=  {@linkplain ASTEqualityExpression EqualityExpression} ( "&" {@linkplain ASTEqualityExpression EqualityExpression} )+
  *
  * 
*/ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeBodyDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeBodyDeclaration.java index e35bfc3ceb..d90fa674b8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeBodyDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnyTypeBodyDeclaration.java @@ -61,7 +61,7 @@ public interface ASTAnyTypeBodyDeclaration extends JavaNode { EMPTY, /** See {@link ASTRecordDeclaration}. */ RECORD, - /** See {@link ASTRecordConstructorDeclaration}. */ + /** See {@link ASTCompactConstructorDeclaration}. */ RECORD_CONSTRUCTOR } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignmentOperator.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignmentOperator.java index e562b19a83..60cae11ea4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignmentOperator.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignmentOperator.java @@ -9,11 +9,11 @@ import net.sourceforge.pmd.annotation.InternalApi; /** * Represents an assignment operator in an {@linkplain ASTExpression assignment expression}. * - *
+ * 
{@code
  *
  *  AssignmentOperator ::= "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|="
  *
- * 
+ * }
*/ public class ASTAssignmentOperator extends AbstractJavaNode { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConditionalAndExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConditionalAndExpression.java index 663326a348..439dd8cba5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConditionalAndExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConditionalAndExpression.java @@ -16,7 +16,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * ConditionalAndExpression ::=  {@linkplain ASTInclusiveOrExpression InclusiveOrExpression} ( "&&" {@linkplain ASTInclusiveOrExpression InclusiveOrExpression} )+
+ * ConditionalAndExpression ::=  {@linkplain ASTInclusiveOrExpression InclusiveOrExpression} ( "&&" {@linkplain ASTInclusiveOrExpression InclusiveOrExpression} )+
  *
  * 
*/ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpression.java index d425b045b1..648ba507ce 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpression.java @@ -16,7 +16,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * RelationalExpression ::=  {@linkplain ASTShiftExpression ShiftExpression} ( ( "<" | ">" | "<=" | ">=" ) {@linkplain ASTShiftExpression ShiftExpression} )+
+ * RelationalExpression ::=  {@linkplain ASTShiftExpression ShiftExpression} ( ( "<" | ">" | "<=" | ">=" ) {@linkplain ASTShiftExpression ShiftExpression} )+
  *
  * 
*/ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTShiftExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTShiftExpression.java index f4084a081c..acf1e2ce8f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTShiftExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTShiftExpression.java @@ -17,7 +17,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * ShiftExpression ::=  {@linkplain ASTAdditiveExpression AdditiveExpression} ( ( "<<"  | {@linkplain ASTRSIGNEDSHIFT RSIGNEDSHIFT} | {@linkplain ASTRUNSIGNEDSHIFT RUNSIGNEDSHIFT} ) {@linkplain ASTAdditiveExpression AdditiveExpression} )+
+ * ShiftExpression ::=  {@linkplain ASTAdditiveExpression AdditiveExpression} ( ( "<<"  | {@linkplain ASTRSIGNEDSHIFT RSIGNEDSHIFT} | {@linkplain ASTRUNSIGNEDSHIFT RUNSIGNEDSHIFT} ) {@linkplain ASTAdditiveExpression AdditiveExpression} )+
  *
  * 
*/ @@ -43,7 +43,7 @@ public class ASTShiftExpression extends AbstractJavaTypeNode { /** - * Returns the image of the operator, i.e. "<<", ">>", or ">>>". + * Returns the image of the operator, i.e. "<<", ">>", or ">>>". */ public String getOperator() { return getImage(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeArguments.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeArguments.java index fe378a117e..3cddf2aaf6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeArguments.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeArguments.java @@ -14,8 +14,8 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- *  TypeArguments ::= "<" {@linkplain ASTTypeArgument TypeArgument} ( "," {@linkplain ASTTypeArgument TypeArgument} )* ">"
- *                  | "<" ">"
+ *  TypeArguments ::= "<" {@linkplain ASTTypeArgument TypeArgument} ( "," {@linkplain ASTTypeArgument TypeArgument} )* ">"
+ *                  | "<" ">"
  * 
*/ public class ASTTypeArguments extends AbstractJavaNode implements Iterable { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBound.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBound.java index a53a2598f8..eab978d94f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBound.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeBound.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * TypeBound ::= "extends" {@linkplain ASTAnnotation Annotation}* {@linkplain ASTClassOrInterfaceType ClassOrInterfaceType} ( "&" {@linkplain ASTAnnotation Annotation}* {@linkplain ASTClassOrInterfaceType ClassOrInterfaceType} )*
+ * TypeBound ::= "extends" {@linkplain ASTAnnotation Annotation}* {@linkplain ASTClassOrInterfaceType ClassOrInterfaceType} ( "&" {@linkplain ASTAnnotation Annotation}* {@linkplain ASTClassOrInterfaceType ClassOrInterfaceType} )*
  *
  * 
*/ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeParameters.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeParameters.java index ede79d399b..cca0e90b3a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeParameters.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTTypeParameters.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.annotation.InternalApi; * *
  *
- * TypeParameters ::= "<" {@linkplain ASTTypeParameter TypeParameter} ( "," {@linkplain ASTTypeParameter TypeParameter} )* ">"
+ * TypeParameters ::= "<" {@linkplain ASTTypeParameter TypeParameter} ( "," {@linkplain ASTTypeParameter TypeParameter} )* ">"
  *
  * 
*/ From 2e0b6292b634a3c580ee4d9c1891402572d3bdf2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 Feb 2023 20:05:25 +0100 Subject: [PATCH 25/70] [doc] Update release notes (#4333) --- docs/pages/release_notes.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 54c9cdb1ae..1993c6ba49 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,7 +14,23 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy +#### Java 20 Support + +This release of PMD brings support for Java 20. There are no new standard language features. + +PMD supports [JEP 433: Pattern Matching for switch (Fourth Preview)](https://openjdk.org/jeps/433) and +[JEP 432: Record Patterns (Second Preview)](https://openjdk.org/jeps/432) as preview language features. + +In order to analyze a project with PMD that uses these language features, +you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language +version `20-preview`: + + export PMD_JAVA_OPTS=--enable-preview + ./run.sh pmd --use-version java-20-preview ... + ### Fixed Issues +* java + * [#4333](https://github.com/pmd/pmd/issues/4333): \[java] Support JDK 20 ### API Changes From ae552979844a1b52ab9203eec38a2effb5822ef5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 4 Feb 2023 20:09:21 +0100 Subject: [PATCH 26/70] Update javadoc --- .../java/net/sourceforge/pmd/lang/java/ast/ASTPattern.java | 3 ++- .../net/sourceforge/pmd/lang/java/ast/ASTRecordPattern.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 d31b1522f6..c7e572c6e6 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 @@ -19,7 +19,8 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see
JEP 394: Pattern Matching for instanceof - * @see JEP 405: Record Patterns (Preview) + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ public interface ASTPattern extends JavaNode { 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 c565971dab..1e3618fc85 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 @@ -11,12 +11,13 @@ import net.sourceforge.pmd.annotation.Experimental; * *
  *
- * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTComponentPatternList ComponentPatternList} [ {@linkplain ASTVariableDeclaratorId VariableDeclaratorId} ]
+ * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTComponentPatternList ComponentPatternList}
  *
  * 
* * @see ASTRecordDeclaration - * @see JEP 432: Record Patterns (Second Preview) + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ @Experimental public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { From cac5b15b56a94fcf3972f7803813edb09fb805f2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 4 Feb 2023 20:14:40 +0100 Subject: [PATCH 27/70] [java] Fix build errors, update LanguageLevelChecker - Update Java20PreviewTreeDumpTest to JUnit5 - Remove GuardedPatterns - Don't use PatternExpression in case labels - Update javadocs --- .../pmd/it/BinaryDistributionIT.java | 13 +- pmd-java/etc/grammar/Java.jjt | 6 +- .../lang/java/ast/ASTForeachStatement.java | 3 +- .../pmd/lang/java/ast/ASTPattern.java | 5 +- .../pmd/lang/java/ast/ASTRecordPattern.java | 5 +- .../ast/internal/LanguageLevelChecker.java | 58 +- .../table/internal/PatternBindingsUtil.java | 5 - .../table/internal/SymbolTableResolver.java | 10 - .../java/ast/Java20PreviewTreeDumpTest.java | 98 +- .../pmd/lang/java/ast/TestExtensions.kt | 4 - .../java19p/DealingWithNull.txt | 329 ++++ .../java19p/EnhancedTypeCheckingSwitch.txt | 143 ++ .../java19p/ExhaustiveSwitch.txt | 116 +- .../GuardedAndParenthesizedPatterns.txt | 375 +++++ .../java19p/PatternsInSwitchLabels.txt | 36 +- .../java19p/RefiningPatternsInSwitch.txt | 247 +++ .../ScopeOfPatternVariableDeclarations.txt | 35 +- .../java20p/DealingWithNull.txt | 347 ++++ .../java20p/EnhancedTypeCheckingSwitch.txt | 188 +++ .../java20p/ExhaustiveSwitch.txt | 96 +- .../GuardedAndParenthesizedPatterns.txt | 422 +++++ .../java20p/PatternsInSwitchLabels.txt | 36 +- .../java20p/RecordPatterns.txt | 1412 +++++++---------- .../RecordPatternsExhaustiveSwitch.txt | 590 +++---- .../java20p/RecordPatternsInEnhancedFor.txt | 516 +++--- .../java20p/RefiningPatternsInSwitch.txt | 257 +++ .../ScopeOfPatternVariableDeclarations.txt | 200 +++ 27 files changed, 3736 insertions(+), 1816 deletions(-) create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 8961324ae8..fe122eff1a 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -33,12 +33,13 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { + " java-1.10, java-1.3, java-1.4, java-1.5, java-1." + System.lineSeparator() + " 6, java-1.7, java-1.8, java-1.9, java-10," + System.lineSeparator() + " java-11, java-12, java-13, java-14, java-15," + System.lineSeparator() - + " java-16, java-17, java-18, java-18-preview," + System.lineSeparator() - + " java-19, java-19-preview, java-5, java-6, java-7," + System.lineSeparator() - + " java-8, java-9, jsp-, kotlin-, kotlin-1.6," + System.lineSeparator() - + " kotlin-1.6-rfc+0.1, modelica-, plsql-, pom-," + System.lineSeparator() - + " scala-2.10, scala-2.11, scala-2.12, scala-2.13," + System.lineSeparator() - + " swift-, vf-, vm-, wsdl-, xml-, xsl-"; + + " java-16, java-17, java-18, java-19," + System.lineSeparator() + + " java-19-preview, java-20, java-20-preview," + System.lineSeparator() + + " java-5, java-6, java-7, java-8, java-9, jsp-," + System.lineSeparator() + + " kotlin-, kotlin-1.6, kotlin-1.6-rfc+0.1," + System.lineSeparator() + + " modelica-, plsql-, pom-, scala-2.10, scala-2.11," + System.lineSeparator() + + " scala-2.12, scala-2.13, swift-, vf-, vm-, wsdl-," + System.lineSeparator() + + " xml-, xsl-"; } private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath(); diff --git a/pmd-java/etc/grammar/Java.jjt b/pmd-java/etc/grammar/Java.jjt index e0234ef722..dbd990f157 100644 --- a/pmd-java/etc/grammar/Java.jjt +++ b/pmd-java/etc/grammar/Java.jjt @@ -2487,11 +2487,7 @@ void CaseLabelElement(ASTSwitchLabel label) #void: "," "default" {label.setDefault();} ] | - LOOKAHEAD(Pattern()) Pattern() { - AbstractJavaNode top = jjtree.popNode(); - top = new ASTPatternExpression((ASTPattern) top); - jjtree.pushNode(top); - } ( LOOKAHEAD({isKeyword("when")}) Guard() )* + LOOKAHEAD(Pattern()) Pattern() [ LOOKAHEAD({isKeyword("when")}) Guard() ] | ConditionalExpression() } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForeachStatement.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForeachStatement.java index ac0e7f9544..d005a2e82b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForeachStatement.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTForeachStatement.java @@ -35,7 +35,8 @@ public final class ASTForeachStatement extends AbstractStatement implements Inte @Override @NonNull public ASTVariableDeclaratorId getVarId() { - return getFirstChildOfType(ASTLocalVariableDeclaration.class).iterator().next(); + // in case of destructuring record patterns, there might be multiple vars + return getFirstChild().descendants(ASTVariableDeclaratorId.class).first(); } /** 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 d31b1522f6..144c2c1e90 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 @@ -7,7 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.annotation.Experimental; /** - * A pattern (for pattern matching constructs like {@link ASTInstanceOfExpression InstanceOfExpression} + * A pattern (for pattern matching constructs like {@link ASTInfixExpression InstanceOfExpression} * or within a {@link ASTSwitchLabel}). This is a JDK 16 feature. * *

This interface is implemented by all forms of patterns. @@ -19,7 +19,8 @@ import net.sourceforge.pmd.annotation.Experimental; * * * @see JEP 394: Pattern Matching for instanceof - * @see JEP 405: Record Patterns (Preview) + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ public interface ASTPattern extends JavaNode { 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 18ad4c7177..0b54f6706f 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 @@ -11,12 +11,13 @@ import net.sourceforge.pmd.annotation.Experimental; * *

  *
- * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTComponentPatternList ComponentPatternList} [ {@linkplain ASTVariableDeclaratorId VariableDeclaratorId} ]
+ * RecordPattern ::= {@linkplain ASTReferenceType ReferenceType} {@linkplain ASTComponentPatternList ComponentPatternList}
  *
  * 
* * @see ASTRecordDeclaration - * @see JEP 432: Record Patterns (Second Preview) + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ @Experimental public final class ASTRecordPattern extends AbstractJavaNode implements ASTPattern { 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 e5caff888e..db76964b8b 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 @@ -19,10 +19,8 @@ import net.sourceforge.pmd.lang.java.ast.ASTCastExpression; import net.sourceforge.pmd.lang.java.ast.ASTCatchClause; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTEnumDeclaration; -import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; -import net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTIntersectionType; import net.sourceforge.pmd.lang.java.ast.ASTLambdaExpression; @@ -31,7 +29,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodReference; import net.sourceforge.pmd.lang.java.ast.ASTModuleDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTNullLiteral; import net.sourceforge.pmd.lang.java.ast.ASTNumericLiteral; -import net.sourceforge.pmd.lang.java.ast.ASTPatternExpression; +import net.sourceforge.pmd.lang.java.ast.ASTPattern; import net.sourceforge.pmd.lang.java.ast.ASTReceiverParameter; import net.sourceforge.pmd.lang.java.ast.ASTRecordDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTRecordPattern; @@ -125,19 +123,9 @@ public class LanguageLevelChecker { * @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) */ - PATTERN_MATCHING_FOR_SWITCH(17, 19, false), - - /** - * Part of pattern matching for switch - * @see #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) - * @deprecated This solution has been discontinued in favor of an explicit guard using "when" keyword - * in Java 19, see {@link #CASE_REFINEMENT}.

- */ - @Deprecated - GUARDED_PATTERNS(17, 18, false), + PATTERN_MATCHING_FOR_SWITCH(17, 20, false), /** * Part of pattern matching for switch @@ -145,21 +133,30 @@ public class LanguageLevelChecker { * @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) */ - NULL_CASE_LABELS(17, 19, false), + NULL_CASE_LABELS(17, 20, false), /** * Part of pattern matching for switch: Case refinement using "when" * @see #PATTERN_MATCHING_FOR_SWITCH * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) + * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) */ - CASE_REFINEMENT(19, 19, false), + CASE_REFINEMENT(19, 20, false), /** * Record patterns - * @see JEP 405: Record Patterns (Preview) + * @see JEP 405: Record Patterns (Preview) (Java 19) + * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ - RECORD_PATTERNS(19, 19, false), + RECORD_PATTERNS(19, 20, false), + + /** + * Record destructuring patterns in for-each loops + * @see JEP 432: Record Patterns (Second Preview) (Java 20) + */ + RECORD_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false), ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome @@ -479,6 +476,9 @@ 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.RECORD_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data); + } return null; } @@ -546,12 +546,6 @@ public class LanguageLevelChecker { return null; } - @Override - public Void visit(ASTGuardedPattern node, T data) { - check(node, PreviewFeature.GUARDED_PATTERNS, data); - return null; - } - @Override public Void visit(ASTSwitchGuard node, T data) { check(node, PreviewFeature.CASE_REFINEMENT, data); @@ -599,15 +593,11 @@ public class LanguageLevelChecker { if (node.isDefault() && JavaTokenKinds.CASE == node.getFirstToken().getKind()) { check(node, PreviewFeature.PATTERN_MATCHING_FOR_SWITCH, data); } - for (ASTExpression expr : node.getExprList()) { - if (expr instanceof ASTPatternExpression) { - check(expr, PreviewFeature.PATTERN_MATCHING_FOR_SWITCH, data); - if (((ASTPatternExpression) expr).getPattern() instanceof ASTGuardedPattern) { - check(expr, PreviewFeature.GUARDED_PATTERNS, data); - } - } else if (expr instanceof ASTNullLiteral) { - check(expr, PreviewFeature.NULL_CASE_LABELS, data); - } + if (node.getFirstChild() instanceof ASTNullLiteral) { + check(node, PreviewFeature.NULL_CASE_LABELS, data); + } + if (node.getFirstChild() instanceof ASTPattern) { + check(node, PreviewFeature.PATTERN_MATCHING_FOR_SWITCH, data); } return null; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternBindingsUtil.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternBindingsUtil.java index 311cb0d2e2..201e30f378 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternBindingsUtil.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternBindingsUtil.java @@ -8,7 +8,6 @@ import org.pcollections.HashTreePSet; import org.pcollections.PSet; import net.sourceforge.pmd.lang.java.ast.ASTExpression; -import net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern; import net.sourceforge.pmd.lang.java.ast.ASTInfixExpression; import net.sourceforge.pmd.lang.java.ast.ASTPattern; import net.sourceforge.pmd.lang.java.ast.ASTPatternExpression; @@ -98,10 +97,6 @@ final class PatternBindingsUtil { return BindSet.whenTrue(BindSet.noBindings()); } return BindSet.whenTrue(HashTreePSet.singleton(varId)); - } else if (pattern instanceof ASTGuardedPattern) { - BindSet patternBindings = bindersOfPattern(((ASTGuardedPattern) pattern).getPattern()); - BindSet guardBindings = bindersOfExpr(((ASTGuardedPattern) pattern).getGuard()); - return patternBindings.union(guardBindings); } else { throw AssertionUtil.shouldNotReachHere("no other instances of pattern should exist: " + pattern); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java index 58f120a9c0..1233f48b0b 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymbolTableResolver.java @@ -38,7 +38,6 @@ import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTForStatement; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; -import net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern; import net.sourceforge.pmd.lang.java.ast.ASTIfStatement; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTInfixExpression; @@ -512,15 +511,6 @@ public final class SymbolTableResolver { return node.getRightOperand().acceptVisitor(this, ctx); } - @Override - public Void visit(ASTGuardedPattern node, @NonNull ReferenceCtx ctx) { - BindSet bindSet = PatternBindingsUtil.bindersOfPattern(node.getPattern()); - int pushed = pushOnStack(f.localVarSymTable(top(), enclosing(), bindSet.getTrueBindings())); - setTopSymbolTableAndVisit(node.getGuard(), ctx); - popStack(pushed); - return null; - } - @Override public Void visit(ASTConditionalExpression node, @NonNull ReferenceCtx ctx) { // need to account for pattern bindings. 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 index 9c2926d64f..473d599bea 100644 --- 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 @@ -4,11 +4,10 @@ package net.sourceforge.pmd.lang.java.ast; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; -import org.junit.function.ThrowingRunnable; +import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.ast.ParseException; import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; @@ -16,13 +15,13 @@ import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; import net.sourceforge.pmd.lang.java.JavaParsingHelper; -public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { +class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { private final JavaParsingHelper java20p = - JavaParsingHelper.WITH_PROCESSING.withDefaultVersion("20-preview") + JavaParsingHelper.DEFAULT.withDefaultVersion("20-preview") .withResourceContext(Java20PreviewTreeDumpTest.class, "jdkversiontests/java20p/"); private final JavaParsingHelper java20 = java20p.withDefaultVersion("20"); - public Java20PreviewTreeDumpTest() { + Java20PreviewTreeDumpTest() { super(new RelevantAttributePrinter(), ".java"); } @@ -32,112 +31,87 @@ public class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { } @Test - public void dealingWithNullBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java20.parseResource("DealingWithNull.java"); - } - }); - assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Null case labels in switch are only supported with JDK 19 Preview or JDK 20 Preview.")); + void dealingWithNullBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); + assertTrue(thrown.getMessage().contains("Null case labels is a preview feature of JDK 20, you should select your language version accordingly"), + "Unexpected message: " + thrown.getMessage()); } @Test - public void dealingWithNull() { + void dealingWithNull() { doTest("DealingWithNull"); } @Test - public void enhancedTypeCheckingSwitch() { + void enhancedTypeCheckingSwitch() { doTest("EnhancedTypeCheckingSwitch"); } @Test - public void exhaustiveSwitch() { + void exhaustiveSwitch() { doTest("ExhaustiveSwitch"); } @Test - public void guardedAndParenthesizedPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java20.parseResource("GuardedAndParenthesizedPatterns.java"); - } - }); - assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); + void guardedAndParenthesizedPatternsBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedAndParenthesizedPatterns.java")); + assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 20, you should select your language version accordingly"), + "Unexpected message: " + thrown.getMessage()); } @Test - public void guardedAndParenthesizedPatterns() { + void guardedAndParenthesizedPatterns() { doTest("GuardedAndParenthesizedPatterns"); } @Test - public void patternsInSwitchLabelsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java20.parseResource("PatternsInSwitchLabels.java"); - } - }); - assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Pattern Matching in Switch is only supported with JDK 19 Preview or JDK 20 Preview.")); + void patternsInSwitchLabelsBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); + assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 20, you should select your language version accordingly"), + "Unexpected message: " + thrown.getMessage()); } @Test - public void patternsInSwitchLabels() { + void patternsInSwitchLabels() { doTest("PatternsInSwitchLabels"); } @Test - public void refiningPatternsInSwitch() { + void refiningPatternsInSwitch() { doTest("RefiningPatternsInSwitch"); } @Test - public void scopeOfPatternVariableDeclarations() { + void scopeOfPatternVariableDeclarations() { doTest("ScopeOfPatternVariableDeclarations"); } @Test - public void recordPatterns() { + void recordPatterns() { doTest("RecordPatterns"); } @Test - public void recordPatternsBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java20.parseResource("RecordPatterns.java"); - } - }); - assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Record Patterns are only supported with JDK 19 Preview or JDK 20 Preview.")); + 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 - public void recordPatternsInEnhancedFor() { + void recordPatternsInEnhancedFor() { doTest("RecordPatternsInEnhancedFor"); } @Test - public void recordPatternsInEnhancedForBeforeJava20Preview() { - ParseException thrown = assertThrows(ParseException.class, new ThrowingRunnable() { - @Override - public void run() throws Throwable { - java20.parseResource("RecordPatternsInEnhancedFor.java"); - } - }); - assertTrue("Unexpected message: " + thrown.getMessage(), - thrown.getMessage().contains("Record Patterns in enhanced for statements are only supported with JDK 20 Preview.")); + void recordPatternsInEnhancedForBeforeJava20Preview() { + ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatternsInEnhancedFor.java")); + assertTrue(thrown.getMessage().contains("Record patterns in enhanced for statement is a preview feature of JDK 20, you should select your language version accordingly"), + "Unexpected message: " + thrown.getMessage()); } @Test - public void recordPatternsExhaustiveSwitch() { + void recordPatternsExhaustiveSwitch() { doTest("RecordPatternsExhaustiveSwitch"); } } 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 6e310638bc..5448c48ec7 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 @@ -408,10 +408,6 @@ fun TreeNodeWrapper.typePattern(contents: NodeSpec) = child(ignoreChildren = contents == EmptyAssertions) { contents() } -fun TreeNodeWrapper.guardedPattern(contents: NodeSpec) = - child(ignoreChildren = contents == EmptyAssertions) { - contents() - } fun TreeNodeWrapper.arrayType(contents: NodeSpec = EmptyAssertions) = diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt new file mode 100644 index 0000000000..d2302bcfa7 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/DealingWithNull.txt @@ -0,0 +1,329 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "DealingWithNull", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 6] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBar", @MainMethod = false, @MethodName = "testFooBar", @Name = "testFooBar", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Oops", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Oops\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Foo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bar", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Great", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Great\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ok", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ok\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrNull", @MainMethod = false, @MethodName = "testStringOrNull", @Name = "testStringOrNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Integer", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @MainMethod = false, @MethodName = "test3", @Name = "test3", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ExpressionStatement[] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String, including null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @Length = 22, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- BreakStatement[@Label = null] + | | +- SwitchFallthroughBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- BreakStatement[@Label = null] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String, including null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String, including null\"", @IntLiteral = false, @Length = 22, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- SwitchFallthroughBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "The rest (including null)", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @Length = 25, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "The rest (including null)", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @Length = 25, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 12, @containsComment = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = 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, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Foo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bar", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "baz", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"baz\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "some string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"some string\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt new file mode 100644 index 0000000000..c4629ea16e --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/EnhancedTypeCheckingSwitch.txt @@ -0,0 +1,143 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = false, @Size = 2] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @MainMethod = false, @MethodName = "typeTester", @Name = "typeTester", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | | +- ModifierList[] + | | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | | +- FormalParameters[@Empty = false, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Color with ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Color with \"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " values", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" values\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Record class: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] + | | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | | | +- ArrayTypeDim[@Varargs = false] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ia", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Array of ints of length", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Array of ints of length\"", @IntLiteral = false, @Length = 23, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ia"] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclarator[@Initializer = true, @Name = "o"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "j", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt index c2a16ed395..7eadf564b2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ExhaustiveSwitch.txt @@ -16,21 +16,19 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] @@ -49,21 +47,19 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] @@ -81,11 +77,10 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -96,11 +91,10 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -153,27 +147,24 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "switchStatementExhaustive", @MainMethod = false, @MethodName = "switchStatementExhaustive", @Name = "switchStatementExhaustive", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] @@ -188,11 +179,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -203,11 +193,10 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -269,13 +258,12 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "F", @TypeImage = "F"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bi", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "F", @TypeImage = "F"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bi", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] +- ModifierList[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt new file mode 100644 index 0000000000..3607a3ec21 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/GuardedAndParenthesizedPatterns.txt @@ -0,0 +1,375 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "GuardedAndParenthesizedPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "single char string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @MainMethod = false, @MethodName = "testIdentifierWhen", @Name = "testIdentifierWhen", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "when", @LambdaParameter = false, @LocalVariable = false, @Name = "when", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "when", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @MainMethod = false, @MethodName = "testIdentifierWhen", @Name = "testIdentifierWhen", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "when"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "when", @LambdaParameter = false, @LocalVariable = true, @Name = "when", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "when", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @MainMethod = false, @MethodName = "testWithNull", @Name = "testWithNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "single char string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 2, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "instanceOfPattern", @MainMethod = false, @MethodName = "instanceOfPattern", @Name = "instanceOfPattern", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least two characters\"", @IntLiteral = false, @Length = 43, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.NE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least three characters\"", @IntLiteral = false, @Length = 45, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @Length = 44, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 7, @containsComment = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "fooo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"fooo\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "instanceOfPattern", @MethodName = "instanceOfPattern", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "abcde", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"abcde\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt index f7ece40126..f69b241d3d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/PatternsInSwitchLabels.txt @@ -29,11 +29,10 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -42,11 +41,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -55,11 +53,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -68,11 +65,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt new file mode 100644 index 0000000000..35991e0927 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/RefiningPatternsInSwitch.txt @@ -0,0 +1,247 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RefiningPatternsInSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Shape", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Triangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | +- ClassOrInterfaceBody[@Empty = false, @Size = 3] + | +- FieldDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @VariableName = "area", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = false, @Name = "area"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "area", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Triangle", @Name = "Triangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false, @containsComment = false] + | | +- ModifierList[] + | | +- FormalParameters[@Empty = false, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "area", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ThisExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "calculateArea", @MainMethod = false, @MethodName = "calculateArea", @Name = "calculateArea", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangle", @MainMethod = false, @MethodName = "testTriangle", @Name = "testTriangle", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- BreakStatement[@Label = null] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- BreakStatement[@Label = null] + | +- SwitchFallthroughBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined", @MainMethod = false, @MethodName = "testTriangleRefined", @Name = "testTriangleRefined", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined2", @MainMethod = false, @MethodName = "testTriangleRefined2", @Name = "testTriangleRefined2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Small triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Non-triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Non-triangle\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 12, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "large"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "large", @LambdaParameter = false, @LocalVariable = true, @Name = "large", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "large", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "small"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "small", @LambdaParameter = false, @LocalVariable = true, @Name = "small", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "small", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "rect"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "rect", @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "rect", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt index dccc5b96fd..af2582f69d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java19p/ScopeOfPatternVariableDeclarations.txt @@ -15,16 +15,15 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -44,11 +43,10 @@ | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Character", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Character\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "IllegalStateException", @TypeImage = "IllegalStateException"] @@ -56,7 +54,7 @@ | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Invalid Integer argument of value \"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] @@ -75,15 +73,14 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -97,7 +94,7 @@ | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] 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 new file mode 100644 index 0000000000..73a1ad57d3 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/DealingWithNull.txt @@ -0,0 +1,347 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "DealingWithNull", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 6] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testFooBar", @MainMethod = false, @MethodName = "testFooBar", @Name = "testFooBar", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Oops", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Oops\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Foo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bar", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Great", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Great\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ok", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ok\"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrNull", @MainMethod = false, @MethodName = "testStringOrNull", @Name = "testStringOrNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testStringOrDefaultNull", @MainMethod = false, @MethodName = "testStringOrDefaultNull", @Name = "testStringOrDefaultNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null or default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null or default case\"", @IntLiteral = false, @Length = 20, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String: \"", @IntLiteral = false, @Length = 8, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Integer", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Integer\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @MainMethod = false, @MethodName = "test3", @Name = "test3", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 4, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- ExpressionStatement[] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- BreakStatement[@Label = null] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ExpressionStatement[] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- BreakStatement[@Label = null] + | | +- SwitchFallthroughBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- BreakStatement[@Label = null] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchFallthroughBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- SwitchFallthroughBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "The rest (including null)", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @Length = 25, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "The rest (including null)", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"The rest (including null)\"", @IntLiteral = false, @Length = 25, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 12, @containsComment = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = 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, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test3", @MethodName = "test3", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Foo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Foo\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Bar", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Bar\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testFooBar", @MethodName = "testFooBar", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "baz", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"baz\"", @IntLiteral = false, @Length = 3, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testStringOrNull", @MethodName = "testStringOrNull", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "some string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"some string\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] 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 new file mode 100644 index 0000000000..983a2eeb21 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/EnhancedTypeCheckingSwitch.txt @@ -0,0 +1,188 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "EnhancedTypeCheckingSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = false, @Size = 2] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "typeTester", @MainMethod = false, @MethodName = "typeTester", @Name = "typeTester", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | | +- ModifierList[] + | | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | | +- FormalParameters[@Empty = false, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Color with ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Color with \"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " values", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" values\"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Record class: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Record class: \"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "p"] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- SwitchArrowBranch[@Default = false] + | | | +- SwitchLabel[@Default = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] + | | | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | | | +- ArrayTypeDim[@Varargs = false] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ia", @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ia", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Array of ints of length ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Array of ints of length \"", @IntLiteral = false, @Length = 24, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "length", @Name = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ia", @Name = "ia", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ia"] + | | +- SwitchArrowBranch[@Default = true] + | | +- SwitchLabel[@Default = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Something else", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Something else\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 9, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclarator[@Initializer = true, @Name = "o"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "o", @LambdaParameter = false, @LocalVariable = true, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "test", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"test\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | +- ExpressionStatement[] + | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "int[]"] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Expression = true, @Length = 4, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] + | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ExpressionStatement[] + | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "j", @LambdaParameter = false, @LocalVariable = false, @Name = "j", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "j", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Color", @CanonicalName = "Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + +- ModifierList[] + +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt index 32d7f461ba..25465df7a7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ExhaustiveSwitch.txt @@ -16,21 +16,19 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] @@ -48,11 +46,10 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -63,11 +60,10 @@ | | +- BreakStatement[@Label = null] | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -120,27 +116,24 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "switchStatementExhaustive", @MainMethod = false, @MethodName = "switchStatementExhaustive", @Name = "switchStatementExhaustive", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] | +- ModifierList[] @@ -155,11 +148,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -170,11 +162,10 @@ | | | +- BreakStatement[@Label = null] | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] - | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | | +- ModifierList[] - | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] - | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -236,13 +227,12 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] - | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | +- ModifierList[] - | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "F", @TypeImage = "F"] - | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bi", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "F", @TypeImage = "F"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "bi", @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bi", @Visibility = Visibility.V_LOCAL, @Volatile = false] | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] +- ModifierList[] 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 new file mode 100644 index 0000000000..1af8bec44d --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/GuardedAndParenthesizedPatterns.txt @@ -0,0 +1,422 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns", @CanonicalName = "GuardedAndParenthesizedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "GuardedAndParenthesizedPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedAndParenthesizedPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 8] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "single char string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @MainMethod = false, @MethodName = "testIdentifierWhen", @Name = "testIdentifierWhen", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "when", @LambdaParameter = false, @LocalVariable = false, @Name = "when", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "when", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testIdentifierWhen", @MainMethod = false, @MethodName = "testIdentifierWhen", @Name = "testIdentifierWhen", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "when"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "when", @LambdaParameter = false, @LocalVariable = true, @Name = "when", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "when", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedAndParenthesizedPatterns$when", @CanonicalName = "GuardedAndParenthesizedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Image = "when", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testWithNull", @MainMethod = false, @MethodName = "testWithNull", @Name = "testWithNull", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "s"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "single char string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"single char string\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"string\"", @IntLiteral = false, @Length = 6, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 1, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "integer 1", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"integer 1\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 2, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 2, @Parenthesized = true] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "longValue", @MethodName = "longValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "l"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long 1 with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long 1 with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 3, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "double with parens", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"double with parens\"", @IntLiteral = false, @Length = 18, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "null!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"null!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "default case", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"default case\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "instanceOfPattern", @MainMethod = false, @MethodName = "instanceOfPattern", @Name = "instanceOfPattern", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least two characters\"", @IntLiteral = false, @Length = 43, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.NE, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least three characters\"", @IntLiteral = false, @Length = 45, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A string containing at least four characters\"", @IntLiteral = false, @Length = 44, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testScopeOfPatternVariableDeclarations", @MainMethod = false, @MethodName = "testScopeOfPatternVariableDeclarations", @Name = "testScopeOfPatternVariableDeclarations", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = true] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ArgumentList[@Empty = true, @Size = 0] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Not a string", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Not a string\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 9, @containsComment = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "fooo", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"fooo\"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1L", @IntLiteral = false, @Integral = true, @LongLiteral = true, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "instanceOfPattern", @MethodName = "instanceOfPattern", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "abcde", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"abcde\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "NullPointerException", @TypeImage = "NullPointerException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testWithNull", @MethodName = "testWithNull", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testScopeOfPatternVariableDeclarations", @MethodName = "testScopeOfPatternVariableDeclarations", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "long enough", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"long enough\"", @IntLiteral = false, @Length = 11, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt index f7ece40126..f69b241d3d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/PatternsInSwitchLabels.txt @@ -29,11 +29,10 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -42,11 +41,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Long", @TypeImage = "Long"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "l", @LambdaParameter = false, @LocalVariable = false, @Name = "l", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "l", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -55,11 +53,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Double", @TypeImage = "Double"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] @@ -68,11 +65,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] - | | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] - | | | +- ModifierList[] - | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] - | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt index 34715ff83d..038308fdb6 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatterns.txt @@ -1,855 +1,557 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatterns", @Default = false, @Final = false, @Image = "RecordPatterns", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.ENUM] - | +- EnumDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] - | +- EnumBody[] - | +- EnumConstant[@AnonymousClass = false, @Image = "RED"] - | +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] - | +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$ColoredPoint", @Default = false, @Final = true, @Image = "ColoredPoint", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "ColoredPoint", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Rectangle", @Default = false, @Final = true, @Image = "Rectangle", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Rectangle", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "upperLeft"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lowerRight"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printSum1", @Modifiers = 0, @Name = "printSum1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printSum1", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "p.x"] - | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- BlockStatement[@Allocation = false] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "p.y"] - | | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 0, @Size = 0] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "x"] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "y"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printSum2", @Modifiers = 0, @Name = "printSum2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printSum2", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "o"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "o"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "x"] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "y"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColoredPoint", @Modifiers = 0, @Name = "printUpperLeftColoredPoint", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printUpperLeftColoredPoint", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "r"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ul", @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ul"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "ul.c"] - | +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 0, @Size = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printColorOfUpperLeftPoint", @Modifiers = 0, @Name = "printColorOfUpperLeftPoint", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printColorOfUpperLeftPoint", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "r"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- ComponentPatternList[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "c"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 6, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "createRectangle", @Modifiers = 0, @Name = "createRectangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = false, @Volatile = false] - | +- ResultType[@Void = false, @returnsArray = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | +- MethodDeclarator[@Image = "createRectangle", @ParameterCount = 6] - | | +- FormalParameters[@ParameterCount = 6, @Size = 6] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x1", @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x1"] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y1", @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y1"] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c1", @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c1"] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x2", @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x2"] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y2", @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y2"] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c2", @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c2"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = true] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "r", @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- AllocationExpression[@AnonymousClass = false] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | | +- ArgumentList[@Size = 2] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- AllocationExpression[@AnonymousClass = false] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | | | +- ArgumentList[@Size = 2] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | | +- PrimaryExpression[] - | | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | | +- Name[@Image = "x1"] - | | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "y1"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "c1"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- AllocationExpression[@AnonymousClass = false] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | | +- ArgumentList[@Size = 2] - | | | +- Expression[@StandAlonePrimitive = false] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Name[@Image = "x2"] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "y2"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "c2"] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ReturnStatement[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "r"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Modifiers = 0, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printXCoordOfUpperLeftPointWithPatterns", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Rectangle"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "r"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- ComponentPatternList[] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | | +- ComponentPatternList[] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Upper-left corner: \"", @FloatLiteral = false, @Image = "\"Upper-left corner: \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Upper-left corner: \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "x"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "nestedPatternsCanFailToMatch", @Modifiers = 0, @Name = "nestedPatternsCanFailToMatch", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "nestedPatternsCanFailToMatch", @ParameterCount = 0] - | | +- FormalParameters[@ParameterCount = 0, @Size = 0] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = true] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = true] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] - | | +- Expression[@StandAlonePrimitive = true] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "42", @FloatLiteral = false, @Image = "42", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "42", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 42, @ValueAsLong = 42] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = true] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "p"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | +- Statement[] - | | +- Block[@containsComment = false] - | | +- BlockStatement[@Allocation = false] - | | +- Statement[] - | | +- StatementExpression[] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "s"] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\", \"", @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\", \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "t"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"Not a pair of strings\"", @FloatLiteral = false, @Image = "\"Not a pair of strings\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"Not a pair of strings\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatterns$Box", @Default = false, @Final = true, @Image = "Box", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Box", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- TypeParameters[] - | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] - | +- RecordComponentList[@Size = 1] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "t"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1a", @Modifiers = 0, @Name = "test1a", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test1a", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "bo"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "String"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "s"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test1", @Modifiers = 0, @Name = "test1", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test1", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "bo"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "s"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test2", @Modifiers = 0, @Name = "test2", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test2", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "bo"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "s"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test3", @Modifiers = 0, @Name = "test3", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "test3", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- IfStatement[@Else = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- InstanceOfExpression[] - | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "bo"] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "s"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test4", @Modifiers = 0, @Name = "test4", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "test4", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Box"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "bo"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- IfStatement[@Else = false] - +- Expression[@StandAlonePrimitive = false] - | +- InstanceOfExpression[] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "bo"] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | +- ComponentPatternList[] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Box", @ReferenceToClassSameCompilationUnit = false] - | +- ComponentPatternList[] - | +- TypePattern[@ParenthesisDepth = 0] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - +- Statement[] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "System.out.println"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- AdditiveExpression[@Image = "+", @Operator = "+"] - +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"String \"", @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"String \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Name[@Image = "s"] ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatterns", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@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, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- 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, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- 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, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "upperLeft", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lowerRight", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum1", @MainMethod = false, @MethodName = "printSum1", @Name = "printSum1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 3, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "x"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = true, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = true, @Name = "y"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = true, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = true, @Size = 0] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printSum2", @MainMethod = false, @MethodName = "printSum2", @Name = "printSum2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColoredPoint", @MainMethod = false, @MethodName = "printUpperLeftColoredPoint", @Name = "printUpperLeftColoredPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ul", @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ul", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] + | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "ul"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printColorOfUpperLeftPoint", @MainMethod = false, @MethodName = "printColorOfUpperLeftPoint", @Name = "printColorOfUpperLeftPoint", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "createRectangle", @MainMethod = false, @MethodName = "createRectangle", @Name = "createRectangle", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- FormalParameters[@Empty = false, @Size = 6] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x1", @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y1", @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c1", @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "x2", @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "y2", @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "c2", @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclarator[@Initializer = true, @Name = "r"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "r", @LambdaParameter = false, @LocalVariable = true, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ReturnStatement[] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printXCoordOfUpperLeftPointWithPatterns", @MainMethod = false, @MethodName = "printXCoordOfUpperLeftPointWithPatterns", @Name = "printXCoordOfUpperLeftPointWithPatterns", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | | +- ModifierList[] + | | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Upper-left corner: \"", @IntLiteral = false, @Length = 19, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "nestedPatternsCanFailToMatch", @MainMethod = false, @MethodName = "nestedPatternsCanFailToMatch", @Name = "nestedPatternsCanFailToMatch", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- VariableDeclarator[@Initializer = true, @Name = "p"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = true, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- IfStatement[@Else = true] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = ", ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Not a pair of strings\"", @IntLiteral = false, @Length = 21, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "Box", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] + | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1a", @MainMethod = false, @MethodName = "test1a", @Name = "test1a", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test1", @MainMethod = false, @MethodName = "test1", @Name = "test1", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test3", @MainMethod = false, @MethodName = "test3", @Name = "test3", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- IfStatement[@Else = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- ComponentPatternList[@Empty = false, @Size = 1] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test4", @MainMethod = false, @MethodName = "test4", @Name = "test4", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box>"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "bo", @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "bo", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- IfStatement[@Else = false] + +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] + | +- PatternExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- ComponentPatternList[@Empty = false, @Size = 1] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Box", @TypeImage = "Box"] + | +- ComponentPatternList[@Empty = false, @Size = 1] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "String ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"String \"", @IntLiteral = false, @Length = 7, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt index a12d5b9ee9..7e3ac507f4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsExhaustiveSwitch.txt @@ -1,353 +1,237 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @Default = false, @Final = false, @Image = "RecordPatternsExhaustiveSwitch", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @Default = false, @Final = false, @Image = "A", @Interface = false, @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "A", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @Default = false, @Final = false, @Image = "B", @Interface = false, @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "B", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ExtendsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.INTERFACE] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @Default = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Modifiers = 16384, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = true, @SimpleName = "I", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.INTERFACE, @Volatile = false] - | +- PermitsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @Default = false, @Final = true, @Image = "C", @Interface = false, @Local = false, @Modifiers = 32, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.CLASS] - | +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @Default = false, @Final = true, @Image = "D", @Interface = false, @Local = false, @Modifiers = 32, @Native = false, @Nested = true, @NonSealed = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Sealed = false, @SimpleName = "D", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - | +- ImplementsList[] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- TypeParameters[] - | | +- TypeParameter[@Image = "T", @Name = "T", @ParameterName = "T", @TypeBound = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "T"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "T", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "test", @Modifiers = 16, @Name = "test", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "test", @ParameterCount = 0] - | +- FormalParameters[@ParameterCount = 0, @Size = 0] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p1", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclarator[@Initializer = true, @Name = "p1"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p1", @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p1"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- NullLiteral[] - +- BlockStatement[@Allocation = false] - | +- LocalVariableDeclaration[@Abstract = false, @Array = false, @ArrayDepth = 0, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "p2", @Volatile = false] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Pair"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclarator[@Initializer = true, @Name = "p2"] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p2", @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p2"] - | +- VariableInitializer[] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- NullLiteral[] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "p1"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | | +- TypeArguments[@Diamond = false] - | | | | +- TypeArgument[@Wildcard = false] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- ComponentPatternList[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | | +- TypeArguments[@Diamond = false] - | | | | +- TypeArgument[@Wildcard = false] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- ComponentPatternList[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "B"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "B", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "b"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a1", @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a1"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "A"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "A", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a2", @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "a2"] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"exhaustive now\"", @FloatLiteral = false, @Image = "\"exhaustive now\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"exhaustive now\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "p2"] - | +- SwitchLabeledExpression[] - | | +- SwitchLabel[@Default = false] - | | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | | +- TypeArguments[@Diamond = false] - | | | | +- TypeArgument[@Wildcard = false] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | | +- ComponentPatternList[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Name[@Image = "System.out.println"] - | | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | | +- Arguments[@ArgumentCount = 1, @Size = 1] - | | +- ArgumentList[@Size = 1] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- SwitchStatement[@DefaultCase = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] - +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "p2"] - +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "I"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "i"] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- SwitchLabeledExpression[] - | +- SwitchLabel[@Default = false] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | +- TypeArguments[@Diamond = false] - | | | +- TypeArgument[@Wildcard = false] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "C"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "C", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- SwitchLabeledExpression[] - +- SwitchLabel[@Default = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- TypeArguments[@Diamond = false] - | | +- TypeArgument[@Wildcard = false] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "I", @ReferenceToClassSameCompilationUnit = true] - | +- ComponentPatternList[] - | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d1", @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d1"] - | +- TypePattern[@ParenthesisDepth = 0] - | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "D"] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "D", @ReferenceToClassSameCompilationUnit = true] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d2", @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "d2"] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "System.out.println"] - +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 1, @Size = 1] - +- ArgumentList[@Size = 1] - +- Expression[@StandAlonePrimitive = false] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"a\"", @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"a\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatternsExhaustiveSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "A", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "B", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "I", @Interface = true, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- PermitsList[@Empty = false, @Size = 2] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "C", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "D", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = true, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ImplementsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- ClassOrInterfaceBody[@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, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- TypeParameters[@Empty = false, @Size = 1] + | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "T", @TypeImage = "T"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "test", @MainMethod = false, @MethodName = "test", @Name = "test", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = true, @Size = 0] + +- Block[@Empty = false, @Size = 5, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | +- VariableDeclarator[@Initializer = true, @Name = "p1"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p1", @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- VariableDeclarator[@Initializer = true, @Name = "p2"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p2", @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "B", @TypeImage = "B"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "b", @LambdaParameter = false, @LocalVariable = false, @Name = "b", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "b", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a", @LambdaParameter = false, @LocalVariable = false, @Name = "a", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a1", @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "A", @TypeImage = "A"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "a2", @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "a2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "exhaustive now", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"exhaustive now\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "p2", @Name = "p2", @ParenthesisDepth = 0, @Parenthesized = false] + +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchArrowBranch[@Default = false] + | +- SwitchLabel[@Default = false] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d", @LambdaParameter = false, @LocalVariable = false, @Name = "d", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "C", @TypeImage = "C"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- SwitchArrowBranch[@Default = false] + +- SwitchLabel[@Default = false] + | +- RecordPattern[@ParenthesisDepth = 0] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "I", @TypeImage = "I"] + | +- ComponentPatternList[@Empty = false, @Size = 2] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d1", @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d1", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "D", @TypeImage = "D"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "d2", @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "d2", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + +- ArgumentList[@Empty = false, @Size = 1] + +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "a", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"a\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt index 7cb634b3ae..411c416005 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RecordPatternsInEnhancedFor.txt @@ -1,301 +1,215 @@ -+- CompilationUnit[@PackageName = "", @declarationsAreInDefaultPackage = true] - +- TypeDeclaration[] - +- ClassOrInterfaceDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor", @Default = false, @Final = false, @Image = "RecordPatternsInEnhancedFor", @Interface = false, @Local = false, @Modifiers = 1, @Native = false, @Nested = false, @NonSealed = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Sealed = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.CLASS, @Volatile = false] - +- ClassOrInterfaceBody[@AnonymousInnerClass = false, @EnumChild = false] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Point", @Default = false, @Final = true, @Image = "Point", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Point", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "int"] - | | | +- PrimitiveType[@Array = false, @ArrayDepth = 0, @Boolean = false, @Image = "int"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.ENUM] - | +- EnumDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Color", @Default = false, @Final = false, @Image = "Color", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Color", @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeKind = TypeKind.ENUM, @Volatile = false] - | +- EnumBody[] - | +- EnumConstant[@AnonymousClass = false, @Image = "RED"] - | +- EnumConstant[@AnonymousClass = false, @Image = "GREEN"] - | +- EnumConstant[@AnonymousClass = false, @Image = "BLUE"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @Default = false, @Final = true, @Image = "ColoredPoint", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "ColoredPoint", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Rectangle", @Default = false, @Final = true, @Image = "Rectangle", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Rectangle", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "upperLeft"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lowerRight"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "dump", @Modifiers = 16, @Name = "dump", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "dump", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Point"] - | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "pointArray", @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "pointArray"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ForStatement[@Foreach = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "x"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "y"] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "pointArray"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"(\"", @FloatLiteral = false, @Image = "\"(\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"(\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "x"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\", \"", @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\", \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "y"] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\")\"", @FloatLiteral = false, @Image = "\")\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = true, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\")\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "printUpperLeftColors", @Modifiers = 16, @Name = "printUpperLeftColors", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "printUpperLeftColors", @ParameterCount = 1] - | | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Rectangle"] - | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "r"] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ForStatement[@Foreach = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Rectangle", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- RecordPattern[@ParenthesisDepth = 0] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | | +- ComponentPatternList[] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Point"] - | | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Point", @ReferenceToClassSameCompilationUnit = false] - | | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "p"] - | | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Color"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Color", @ReferenceToClassSameCompilationUnit = true] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "c"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "ColoredPoint"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "ColoredPoint", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "lr"] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "r"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "c"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.RECORD] - | +- RecordDeclaration[@Abstract = false, @BinaryName = "RecordPatternsInEnhancedFor$Pair", @Default = false, @Final = true, @Image = "Pair", @Local = false, @Modifiers = 0, @Native = false, @Nested = true, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @SimpleName = "Pair", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyFinal = false, @Transient = false, @TypeKind = TypeKind.RECORD, @Volatile = false] - | +- RecordComponentList[@Size = 2] - | | +- RecordComponent[@Varargs = false] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "fst", @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "fst"] - | | +- RecordComponent[@Varargs = false] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "Object"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Object", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = true, @ForeachVariable = false, @FormalParameter = false, @Image = "snd", @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "snd"] - | +- RecordBody[] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - | +- MethodDeclaration[@Abstract = false, @Arity = 0, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "exceptionTest", @Modifiers = 16, @Name = "exceptionTest", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = false, @Transient = false, @Void = true, @Volatile = false] - | +- ResultType[@Void = true, @returnsArray = false] - | +- MethodDeclarator[@Image = "exceptionTest", @ParameterCount = 0] - | | +- FormalParameters[@ParameterCount = 0, @Size = 0] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = true] - | | +- LocalVariableDeclaration[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @VariableName = "ps", @Volatile = false] - | | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "Pair"] - | | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclarator[@Initializer = true, @Name = "ps"] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ps", @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "ps"] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- ArrayDimsAndInits[@Array = true, @ArrayDepth = 1] - | | +- ArrayInitializer[] - | | +- VariableInitializer[] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- AllocationExpression[@AnonymousClass = false] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | | +- ArgumentList[@Size = 2] - | | | +- Expression[@StandAlonePrimitive = true] - | | | | +- PrimaryExpression[] - | | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "1", @FloatLiteral = false, @Image = "1", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "1", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 1, @ValueAsLong = 1] - | | | +- Expression[@StandAlonePrimitive = true] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "2", @FloatLiteral = false, @Image = "2", @IntLiteral = true, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = "2", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 2, @ValueAsLong = 2] - | | +- VariableInitializer[] - | | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = null, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = false, @TextBlock = false, @TextBlockContent = null, @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | | +- NullLiteral[] - | | +- VariableInitializer[] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- AllocationExpression[@AnonymousClass = false] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- Arguments[@ArgumentCount = 2, @Size = 2] - | | +- ArgumentList[@Size = 2] - | | +- Expression[@StandAlonePrimitive = false] - | | | +- PrimaryExpression[] - | | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"hello\"", @FloatLiteral = false, @Image = "\"hello\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"hello\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\"world\"", @FloatLiteral = false, @Image = "\"world\"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\"world\"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- ForStatement[@Foreach = false] - | +- RecordPattern[@ParenthesisDepth = 0] - | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "Pair", @ReferenceToClassSameCompilationUnit = false] - | | +- ComponentPatternList[] - | | +- TypePattern[@ParenthesisDepth = 0] - | | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "f", @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "f"] - | | +- TypePattern[@ParenthesisDepth = 0] - | | +- Type[@Array = false, @ArrayDepth = 0, @ArrayType = false, @TypeImage = "var"] - | | | +- ReferenceType[@Array = false, @ArrayDepth = 0] - | | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = false, @ArrayDepth = 0, @Image = "var", @ReferenceToClassSameCompilationUnit = false] - | | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = false, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "s"] - | +- Expression[@StandAlonePrimitive = false] - | | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "ps"] - | +- Statement[] - | +- Block[@containsComment = false] - | +- BlockStatement[@Allocation = false] - | +- Statement[] - | +- StatementExpression[] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "System.out.println"] - | +- PrimarySuffix[@ArgumentCount = 1, @Arguments = true, @ArrayDereference = false] - | +- Arguments[@ArgumentCount = 1, @Size = 1] - | +- ArgumentList[@Size = 1] - | +- Expression[@StandAlonePrimitive = false] - | +- AdditiveExpression[@Image = "+", @Operator = "+"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Name[@Image = "f"] - | +- PrimaryExpression[] - | | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | | +- Literal[@CharLiteral = false, @DoubleLiteral = false, @EscapedStringLiteral = "\" -> \"", @FloatLiteral = false, @Image = "\" -> \"", @IntLiteral = false, @LongLiteral = false, @SingleCharacterStringLiteral = false, @StringLiteral = true, @TextBlock = false, @TextBlockContent = "\" -> \"", @ValueAsDouble = NaN, @ValueAsFloat = NaN, @ValueAsInt = 0, @ValueAsLong = 0] - | +- PrimaryExpression[] - | +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "s"] - +- ClassOrInterfaceBodyDeclaration[@AnonymousInnerClass = false, @EnumChild = false, @Kind = DeclarationKind.METHOD] - +- MethodDeclaration[@Abstract = false, @Arity = 1, @Default = false, @Final = false, @InterfaceMember = false, @Kind = MethodLikeKind.METHOD, @MethodName = "main", @Modifiers = 17, @Name = "main", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyPublic = true, @Transient = false, @Void = true, @Volatile = false] - +- ResultType[@Void = true, @returnsArray = false] - +- MethodDeclarator[@Image = "main", @ParameterCount = 1] - | +- FormalParameters[@ParameterCount = 1, @Size = 1] - | +- FormalParameter[@Abstract = false, @Array = true, @ArrayDepth = 1, @Default = false, @ExplicitReceiverParameter = false, @Final = false, @Modifiers = 0, @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @Transient = false, @TypeInferred = false, @Varargs = false, @Volatile = false] - | +- Type[@Array = true, @ArrayDepth = 1, @ArrayType = true, @TypeImage = "String"] - | | +- ReferenceType[@Array = true, @ArrayDepth = 1] - | | +- ClassOrInterfaceType[@AnonymousClass = false, @Array = true, @ArrayDepth = 1, @Image = "String", @ReferenceToClassSameCompilationUnit = false] - | +- VariableDeclaratorId[@Array = false, @ArrayDepth = 0, @ArrayType = true, @ExceptionBlockParameter = false, @ExplicitReceiverParameter = false, @Field = false, @Final = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @ResourceDeclaration = false, @TypeInferred = false, @VariableName = "args"] - +- Block[@containsComment = false] - +- BlockStatement[@Allocation = false] - +- Statement[] - +- StatementExpression[] - +- PrimaryExpression[] - +- PrimaryPrefix[@SuperModifier = false, @ThisModifier = false] - | +- Name[@Image = "exceptionTest"] - +- PrimarySuffix[@ArgumentCount = 0, @Arguments = true, @ArrayDereference = false] - +- Arguments[@ArgumentCount = 0, @Size = 0] ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor", @CanonicalName = "RecordPatternsInEnhancedFor", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RecordPatternsInEnhancedFor", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsInEnhancedFor", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@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, @Image = "Point", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- 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, @Image = "Color", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "RED", @MethodName = "new", @Name = "RED", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "RED", @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "RED", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | | +- ModifierList[] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "GREEN", @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "GREEN", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- EnumConstant[@Abstract = false, @AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = true, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + | +- ModifierList[] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "BLUE", @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = true, @VariableName = "BLUE", @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsInEnhancedFor$ColoredPoint", @CanonicalName = "RecordPatternsInEnhancedFor.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Image = "ColoredPoint", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- 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, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "upperLeft", @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "upperLeft", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lowerRight", @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lowerRight", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "dump", @MainMethod = false, @MethodName = "dump", @Name = "dump", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Point[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "pointArray", @LambdaParameter = false, @LocalVariable = false, @Name = "pointArray", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "pointArray", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ForeachStatement[] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "x", @LambdaParameter = false, @LocalVariable = false, @Name = "x", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "x", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "y", @LambdaParameter = false, @LocalVariable = false, @Name = "y", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "y", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "pointArray", @Name = "pointArray", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "(", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"(\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = ", ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\", \"", @IntLiteral = false, @Length = 2, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = ")", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\")\"", @IntLiteral = false, @Length = 1, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "printUpperLeftColors", @MainMethod = false, @MethodName = "printUpperLeftColors", @Name = "printUpperLeftColors", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Rectangle[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "r", @LambdaParameter = false, @LocalVariable = false, @Name = "r", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "r", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ForeachStatement[] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- RecordPattern[@ParenthesisDepth = 0] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Point", @TypeImage = "Point"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "p", @LambdaParameter = false, @LocalVariable = false, @Name = "p", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "p", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Color", @TypeImage = "Color"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "ColoredPoint", @TypeImage = "ColoredPoint"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "lr", @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "lr", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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, @Image = "Pair", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "fst", @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "fst", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- RecordComponent[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = true, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "snd", @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "snd", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- RecordBody[@Empty = true, @Size = 0] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "exceptionTest", @MainMethod = false, @MethodName = "exceptionTest", @Name = "exceptionTest", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Pair[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- VariableDeclarator[@Initializer = true, @Name = "ps"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "ps", @LambdaParameter = false, @LocalVariable = true, @Name = "ps", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "ps", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "Pair[]"] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | | +- ArrayTypeDim[@Varargs = false] + | | +- ArrayInitializer[@CompileTimeConstant = false, @Expression = true, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | | +- ArgumentList[@Empty = false, @Size = 2] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] + | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ArgumentList[@Empty = false, @Size = 2] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "hello", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"hello\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "world", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"world\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- ForeachStatement[] + | +- RecordPattern[@ParenthesisDepth = 0] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Pair", @TypeImage = "Pair"] + | | +- ComponentPatternList[@Empty = false, @Size = 2] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "f", @LambdaParameter = false, @LocalVariable = false, @Name = "f", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "f", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "var", @TypeImage = "var"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "ps", @Name = "ps", @ParenthesisDepth = 0, @Parenthesized = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = " -> ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\" -> \"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 1, @containsComment = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @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.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt new file mode 100644 index 0000000000..bda1bf2671 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/RefiningPatternsInSwitch.txt @@ -0,0 +1,257 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "RefiningPatternsInSwitch", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 7] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Shape", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Rectangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | +- ClassOrInterfaceBody[@Empty = true, @Size = 0] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Image = "Triangle", @Interface = false, @Local = false, @Native = false, @Nested = true, @PackageName = "", @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @TopLevel = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- ModifierList[] + | +- ExtendsList[@Empty = false, @Size = 1] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | +- ClassOrInterfaceBody[@Empty = false, @Size = 3] + | +- FieldDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Native = false, @PackagePrivate = false, @Private = true, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @VariableName = "area", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | | +- ModifierList[] + | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | +- VariableDeclarator[@Initializer = false, @Name = "area"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = true, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "area", @Visibility = Visibility.V_PRIVATE, @Volatile = false] + | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Triangle", @Name = "Triangle", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false, @containsComment = false] + | | +- ModifierList[] + | | +- FormalParameters[@Empty = false, @Size = 1] + | | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- ModifierList[] + | | | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "area", @LambdaParameter = false, @LocalVariable = false, @Name = "area", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "area", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- ExpressionStatement[] + | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Expression = true, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ThisExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "calculateArea", @MainMethod = false, @MethodName = "calculateArea", @Name = "calculateArea", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false, @Volatile = false] + | +- ModifierList[] + | +- PrimitiveType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @Kind = PrimitiveTypeKind.INT, @PrimitiveType = true, @TypeImage = "int"] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ReturnStatement[] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangle", @MainMethod = false, @MethodName = "testTriangle", @Name = "testTriangle", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- BreakStatement[@Label = null] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- IfStatement[@Else = false] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- BreakStatement[@Label = null] + | +- SwitchFallthroughBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined", @MainMethod = false, @MethodName = "testTriangleRefined", @Name = "testTriangleRefined", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- BreakStatement[@Label = null] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"A shape, possibly a small triangle\"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testTriangleRefined2", @MainMethod = false, @MethodName = "testTriangleRefined2", @Name = "testTriangleRefined2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Shape", @TypeImage = "Shape"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "s", @LambdaParameter = false, @LocalVariable = false, @Name = "s", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "s", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- NullLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = false, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @IntLiteral = false, @LongLiteral = false, @NullLiteral = true, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | +- BreakStatement[@Label = null] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "t", @Name = "t", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "t"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Large triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Large triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "t", @LambdaParameter = false, @LocalVariable = false, @Name = "t", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "t", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Small triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Small triangle\"", @IntLiteral = false, @Length = 14, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Non-triangle", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Non-triangle\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 12, @containsComment = false] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "large"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "large", @LambdaParameter = false, @LocalVariable = true, @Name = "large", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "large", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "small"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "small", @LambdaParameter = false, @LocalVariable = true, @Name = "small", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "small", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Triangle", @TypeImage = "Triangle"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] + +- LocalVariableDeclaration[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- VariableDeclarator[@Initializer = true, @Name = "rect"] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "rect", @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "rect", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Rectangle", @TypeImage = "Rectangle"] + | +- ArgumentList[@Empty = true, @Size = 0] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined", @MethodName = "testTriangleRefined", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "rect", @Name = "rect", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "large", @Name = "large", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "small", @Name = "small", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testTriangleRefined2", @MethodName = "testTriangleRefined2", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @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.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt new file mode 100644 index 0000000000..2599595e42 --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java20p/ScopeOfPatternVariableDeclarations.txt @@ -0,0 +1,200 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassOrInterfaceDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Image = "ScopeOfPatternVariableDeclarations", @Interface = false, @Local = false, @Native = false, @Nested = false, @PackageName = "", @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = false, @TopLevel = true, @Transient = false, @Visibility = Visibility.V_PUBLIC, @Volatile = false] + +- ModifierList[] + +- ClassOrInterfaceBody[@Empty = false, @Size = 4] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "testSwitchBlock", @MainMethod = false, @MethodName = "testSwitchBlock", @Name = "testSwitchBlock", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "obj", @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "obj", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | | +- ModifierList[] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | | +- SwitchGuard[] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ding!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @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, @Image = "testSwitchRule", @MainMethod = false, @MethodName = "testSwitchRule", @Name = "testSwitchRule", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- Block[@Empty = false, @Size = 2, @containsComment = false] + | | +- IfStatement[@Else = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ding!", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ding!\"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Character", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Character\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchArrowBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Integer", @TypeImage = "Integer"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "i", @LambdaParameter = false, @LocalVariable = false, @Name = "i", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "i", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ThrowStatement[] + | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @Expression = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "IllegalStateException", @TypeImage = "IllegalStateException"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Invalid Integer argument of value \"", @IntLiteral = false, @Length = 34, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "i"] + | | +- 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, @Image = "test2", @MainMethod = false, @MethodName = "test2", @Name = "test2", @Native = false, @Overridden = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true, @Volatile = false] + | +- ModifierList[] + | +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + | +- FormalParameters[@Empty = false, @Size = 1] + | | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Object", @TypeImage = "Object"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "o", @LambdaParameter = false, @LocalVariable = false, @Name = "o", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "o", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] + | +- SwitchFallthroughBranch[@Default = false] + | | +- SwitchLabel[@Default = false] + | | | +- TypePattern[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Native = false, @PackagePrivate = true, @ParenthesisDepth = 0, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | | +- ModifierList[] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "Character", @TypeImage = "Character"] + | | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "c", @LambdaParameter = false, @LocalVariable = false, @Name = "c", @Native = false, @PackagePrivate = false, @PatternBinding = true, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "c", @Visibility = Visibility.V_LOCAL, @Volatile = false] + | | +- IfStatement[@Else = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] + | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Ding ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Ding \"", @IntLiteral = false, @Length = 5, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- IfStatement[@Else = false] + | | | +- InfixExpression[@CompileTimeConstant = false, @Expression = true, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | | +- AmbiguousName[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @CompileTimeConstant = false, @Expression = true, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false, @PrimitiveType = false, @TypeImage = "c"] + | | | | | +- ArgumentList[@Empty = true, @Size = 0] + | | | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] + | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | | | +- ExpressionStatement[] + | | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | | +- ArgumentList[@Empty = false, @Size = 1] + | | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "Tab ", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"Tab \"", @IntLiteral = false, @Length = 4, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "character", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"character\"", @IntLiteral = false, @Length = 9, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + | +- SwitchFallthroughBranch[@Default = true] + | +- SwitchLabel[@Default = true] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- StringLiteral[@BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @ConstValue = "fall-through", @DoubleLiteral = false, @Empty = false, @Expression = true, @FloatLiteral = false, @Image = "\"fall-through\"", @IntLiteral = false, @Length = 12, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = true, @TextBlock = false] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "main", @MainMethod = true, @MethodName = "main", @Name = "main", @Native = false, @Overridden = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = true, @Static = true, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = true, @SyntacticallyStatic = true, @Transient = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true, @Volatile = false] + +- ModifierList[] + +- VoidType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "void"] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Native = false, @PackagePrivate = false, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Varargs = false, @Visibility = Visibility.V_LOCAL, @Volatile = false] + | +- ModifierList[] + | +- ArrayType[@ArrayDepth = 1, @ArrayType = true, @ClassOrInterfaceType = false, @PrimitiveType = false, @TypeImage = "String[]"] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "String", @TypeImage = "String"] + | | +- ArrayDimensions[@Empty = false, @Size = 1] + | | +- ArrayTypeDim[@Varargs = false] + | +- VariableDeclaratorId[@Abstract = false, @ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @Image = "args", @LambdaParameter = false, @LocalVariable = false, @Name = "args", @Native = false, @PackagePrivate = false, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "args", @Visibility = Visibility.V_LOCAL, @Volatile = false] + +- Block[@Empty = false, @Size = 4, @containsComment = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- CharLiteral[@BooleanLiteral = false, @CharLiteral = true, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "\'\u0007\'", @IntLiteral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- CharLiteral[@BooleanLiteral = false, @CharLiteral = true, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "\'A\'", @IntLiteral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] + +- TryStatement[@TryWithResources = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = true] + | | +- ExpressionStatement[] + | | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "testSwitchRule", @MethodName = "testSwitchRule", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ArgumentList[@Empty = false, @Size = 1] + | | +- NumericLiteral[@Base = 10, @BooleanLiteral = false, @CharLiteral = false, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] + | +- CatchClause[] + | +- CatchParameter[@Abstract = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Native = false, @PackagePrivate = true, @Private = false, @Protected = false, @Public = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | | +- ModifierList[] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "IllegalStateException", @TypeImage = "IllegalStateException"] + | | +- VariableDeclaratorId[@Abstract = false, @ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @Image = "e", @LambdaParameter = false, @LocalVariable = false, @Name = "e", @Native = false, @PackagePrivate = true, @PatternBinding = false, @Private = false, @Protected = false, @Public = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @Strictfp = false, @Synchronized = false, @SyntacticallyAbstract = false, @SyntacticallyFinal = false, @SyntacticallyPublic = false, @SyntacticallyStatic = false, @Transient = false, @TypeInferred = false, @VariableName = "e", @Visibility = Visibility.V_PACKAGE, @Volatile = false] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- ExpressionStatement[] + | +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] + | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] + | | +- TypeExpression[@CompileTimeConstant = false, @Expression = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- ClassOrInterfaceType[@ArrayDepth = 0, @ArrayType = false, @ClassOrInterfaceType = true, @FullyQualified = false, @PrimitiveType = false, @ReferenceToClassSameCompilationUnit = false, @SimpleName = "System", @TypeImage = "System"] + | +- ArgumentList[@Empty = false, @Size = 1] + | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Expression = true, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] + +- ExpressionStatement[] + +- MethodCall[@CompileTimeConstant = false, @Expression = true, @Image = "test2", @MethodName = "test2", @ParenthesisDepth = 0, @Parenthesized = false] + +- ArgumentList[@Empty = false, @Size = 1] + +- CharLiteral[@BooleanLiteral = false, @CharLiteral = true, @CompileTimeConstant = true, @DoubleLiteral = false, @Expression = true, @FloatLiteral = false, @Image = "\'\\t\'", @IntLiteral = false, @LongLiteral = false, @NullLiteral = false, @NumericLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringLiteral = false] From ba799f74c6224507e9b24dc87f7544b9534ae1be Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 6 Feb 2023 20:41:17 +0100 Subject: [PATCH 28/70] [java] Update parser messages for preview features - These are more aligned to the official javac -Xlint:preview messages. - Update URLs to openjdk.org --- .../ast/internal/LanguageLevelChecker.java | 56 +++++++++---------- .../java/ast/Java19PreviewTreeDumpTest.java | 8 +-- .../java/ast/Java20PreviewTreeDumpTest.java | 10 ++-- 3 files changed, 37 insertions(+), 37 deletions(-) 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 db76964b8b..ae7a7e3b52 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 @@ -125,21 +125,21 @@ public class LanguageLevelChecker { * @see JEP 427: Pattern Matching for switch (Third Preview) (Java 19) * @see JEP 433: Pattern Matching for switch (Fourth Preview) (Java 20) */ - PATTERN_MATCHING_FOR_SWITCH(17, 20, false), + PATTERNS_IN_SWITCH_STATEMENTS(17, 20, false), /** * Part of pattern matching for switch - * @see #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) */ - NULL_CASE_LABELS(17, 20, false), + NULL_IN_SWITCH_CASES(17, 20, false), /** * Part of pattern matching for switch: Case refinement using "when" - * @see #PATTERN_MATCHING_FOR_SWITCH + * @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) */ @@ -150,13 +150,13 @@ public class LanguageLevelChecker { * @see JEP 405: Record Patterns (Preview) (Java 19) * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ - RECORD_PATTERNS(19, 20, false), + DECONSTRUCTION_PATTERNS(19, 20, false), /** - * Record destructuring patterns in for-each loops + * Record deconstruction patterns in for-each loops * @see JEP 432: Record Patterns (Second Preview) (Java 20) */ - RECORD_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false), + DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT(20, 20, false), ; // SUPPRESS CHECKSTYLE enum trailing semi is awesome @@ -293,60 +293,60 @@ public class LanguageLevelChecker { CONCISE_RESOURCE_SYNTAX(9), /** - * @see JEP 361: Switch Expressions + * @see JEP 361: Switch Expressions */ COMPOSITE_CASE_LABEL(14), /** - * @see JEP 361: Switch Expressions + * @see JEP 361: Switch Expressions */ SWITCH_EXPRESSIONS(14), /** - * @see JEP 361: Switch Expressions + * @see JEP 361: Switch Expressions */ SWITCH_RULES(14), /** * @see #SWITCH_EXPRESSIONS - * @see JEP 361: Switch Expressions + * @see JEP 361: Switch Expressions */ YIELD_STATEMENTS(14), /** - * @see JEP 378: Text Blocks + * @see JEP 378: Text Blocks */ TEXT_BLOCK_LITERALS(15), /** * The new escape sequence {@code \s} simply translates to a single space {@code \u0020}. * * @see #TEXT_BLOCK_LITERALS - * @see JEP 378: Text Blocks + * @see JEP 378: Text Blocks */ SPACE_STRING_ESCAPES(15), /** - * @see JEP 359: Records (Preview) (Java 14) - * @see JEP 384: Records (Second Preview) (Java 15) - * @see JEP 395: Records (Java 16) + * @see JEP 359: Records (Preview) (Java 14) + * @see JEP 384: Records (Second Preview) (Java 15) + * @see JEP 395: Records (Java 16) */ RECORD_DECLARATIONS(16), /** - * @see JEP 305: Pattern Matching for instanceof (Preview) (Java 14) - * @see JEP 375: Pattern Matching for instanceof (Second Preview) (Java 15) - * @see JEP 394: Pattern Matching for instanceof (Java 16) + * @see JEP 305: Pattern Matching for instanceof (Preview) (Java 14) + * @see JEP 375: Pattern Matching for instanceof (Second Preview) (Java 15) + * @see JEP 394: Pattern Matching for instanceof (Java 16) */ TYPE_PATTERNS_IN_INSTANCEOF(16), /** * Part of the records JEP 394. * @see #RECORD_DECLARATIONS - * @see JLS changes for Static Members of Inner Classes (Java 16) + * @see JLS changes for Static Members of Inner Classes (Java 16) */ STATIC_LOCAL_TYPE_DECLARATIONS(16), /** - * @see JEP 360: Sealed Classes (Preview) (Java 15) - * @see JEP 397: Sealed Classes (Second Preview) (Java 16) - * @see JEP 409: Sealed Classes (Java 17) + * @see JEP 360: Sealed Classes (Preview) (Java 15) + * @see JEP 397: Sealed Classes (Second Preview) (Java 16) + * @see JEP 409: Sealed Classes (Java 17) */ SEALED_CLASSES(17), @@ -477,7 +477,7 @@ public class LanguageLevelChecker { public Void visit(ASTForeachStatement node, T data) { check(node, RegularLanguageFeature.FOREACH_LOOPS, data); if (node.getFirstChild() instanceof ASTRecordPattern) { - check(node, PreviewFeature.RECORD_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data); + check(node, PreviewFeature.DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT, data); } return null; } @@ -542,7 +542,7 @@ public class LanguageLevelChecker { @Override public Void visit(ASTRecordPattern node, T data) { - check(node, PreviewFeature.RECORD_PATTERNS, data); + check(node, PreviewFeature.DECONSTRUCTION_PATTERNS, data); return null; } @@ -591,13 +591,13 @@ public class LanguageLevelChecker { check(node, RegularLanguageFeature.COMPOSITE_CASE_LABEL, data); } if (node.isDefault() && JavaTokenKinds.CASE == node.getFirstToken().getKind()) { - check(node, PreviewFeature.PATTERN_MATCHING_FOR_SWITCH, data); + check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } if (node.getFirstChild() instanceof ASTNullLiteral) { - check(node, PreviewFeature.NULL_CASE_LABELS, data); + check(node, PreviewFeature.NULL_IN_SWITCH_CASES, data); } if (node.getFirstChild() instanceof ASTPattern) { - check(node, PreviewFeature.PATTERN_MATCHING_FOR_SWITCH, data); + check(node, PreviewFeature.PATTERNS_IN_SWITCH_STATEMENTS, data); } return null; } diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java index 1f602359ec..0f7efbc8af 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java19PreviewTreeDumpTest.java @@ -33,7 +33,7 @@ class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void dealingWithNullBeforeJava19Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("DealingWithNull.java")); - assertTrue(thrown.getMessage().contains("Null case labels is a preview feature of JDK 19, you should select your language version accordingly"), + assertTrue(thrown.getMessage().contains("Null in switch cases is a preview feature of JDK 19, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } @@ -55,7 +55,7 @@ class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void guardedAndParenthesizedPatternsBeforeJava19Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("GuardedAndParenthesizedPatterns.java")); - assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 19, you should select your language version accordingly"), + assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 19, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } @@ -67,7 +67,7 @@ class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void patternsInSwitchLabelsBeforeJava19Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("PatternsInSwitchLabels.java")); - assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 19, you should select your language version accordingly"), + assertTrue(thrown.getMessage().contains("Patterns in switch statements is a preview feature of JDK 19, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } @@ -94,7 +94,7 @@ class Java19PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void recordPatternsBeforeJava19Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java19.parseResource("RecordPatterns.java")); - assertTrue(thrown.getMessage().contains("Record patterns is a preview feature of JDK 19, you should select your language version accordingly"), + assertTrue(thrown.getMessage().contains("Deconstruction patterns is a preview feature of JDK 19, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } } 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 index 473d599bea..e82215bf6b 100644 --- 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 @@ -33,7 +33,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void dealingWithNullBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("DealingWithNull.java")); - assertTrue(thrown.getMessage().contains("Null case labels is a preview feature of JDK 20, you should select your language version accordingly"), + 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()); } @@ -55,7 +55,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void guardedAndParenthesizedPatternsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("GuardedAndParenthesizedPatterns.java")); - assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 20, you should select your language version accordingly"), + 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()); } @@ -67,7 +67,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void patternsInSwitchLabelsBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("PatternsInSwitchLabels.java")); - assertTrue(thrown.getMessage().contains("Pattern matching for switch is a preview feature of JDK 20, you should select your language version accordingly"), + 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()); } @@ -94,7 +94,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @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"), + assertTrue(thrown.getMessage().contains("Deconstruction patterns is a preview feature of JDK 20, you should select your language version accordingly"), "Unexpected message: " + thrown.getMessage()); } @@ -106,7 +106,7 @@ class Java20PreviewTreeDumpTest extends BaseTreeDumpTest { @Test void recordPatternsInEnhancedForBeforeJava20Preview() { ParseException thrown = assertThrows(ParseException.class, () -> java20.parseResource("RecordPatternsInEnhancedFor.java")); - assertTrue(thrown.getMessage().contains("Record patterns in enhanced for statement is a preview feature of JDK 20, you should select your language version accordingly"), + 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()); } From 9bcab3c8201dce7b6463a60505b6d82d49b5d5ca Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Tue, 14 Feb 2023 19:35:51 +0100 Subject: [PATCH 29/70] Fix integration test --- .../java/net/sourceforge/pmd/it/BinaryDistributionIT.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 7932d98acc..3998f7d0e4 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -36,10 +36,9 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { + " java-16, java-17, java-18, java-19," + System.lineSeparator() + " java-19-preview, java-20, java-20-preview," + System.lineSeparator() + " java-5, java-6, java-7, java-8, java-9, jsp-," + System.lineSeparator() - + " kotlin-1.6, kotlin-1.6-rfc+0.1," + System.lineSeparator() - + " modelica-, plsql-, pom-, scala-2.10, scala-2.11," + System.lineSeparator() - + " scala-2.12, scala-2.13, swift-, vf-, vm-, wsdl-," + System.lineSeparator() - + " xml-, xsl-"; + + " kotlin-1.6, kotlin-1.6-rfc+0.1, modelica-," + System.lineSeparator() + + " plsql-, pom-, scala-2.10, scala-2.11, scala-2.12," + System.lineSeparator() + + " scala-2.13, swift-, vf-, vm-, wsdl-, xml-, xsl-"; } private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath(); From b5ea31d53f6c5995c87403c336eb8aa717c6048c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 16 Feb 2023 16:40:24 +0100 Subject: [PATCH 30/70] [core] Support environment variable CLASSPATH with pmd.bat under Windows --- docs/pages/pmd/userdocs/cli_reference.md | 18 ++++++++++++++++-- docs/pages/release_notes.md | 2 ++ pmd-dist/src/main/resources/scripts/pmd.bat | 7 ++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index 2201d4ab53..cbb6fba4d5 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -189,8 +189,22 @@ if you want to analyze a project, that uses one of OpenJDK's [Preview Language F Just set the environment variable `PMD_JAVA_OPTS` before executing PMD, e.g. - export PMD_JAVA_OPTS="--enable-preview" - ./run.sh pmd -d ../../../src/main/java/ -f text -R rulesets/java/quickstart.xml +```shell +export PMD_JAVA_OPTS="--enable-preview" +./run.sh pmd -d ../../../src/main/java/ -f text -R rulesets/java/quickstart.xml +``` + +## Additional runtime classpath + +If you develop custom rules and package them as a jar file, you need to add it to PMD's runtime classpath. +You can either copy the jar file into the `lib/` subfolder alongside the other jar files, that are in PMD's +standard distribution. + +Or you can set the environment variable `CLASSPATH` before starting PMD, e.g. + +```shell +CLASSPATH=custom-rule-example.jar ./run.sh pmd -d ../../../src/main/java/ -f text -R myrule.xml +``` ## Exit Status diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 75d5480d5d..c302ba42ea 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -15,6 +15,8 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy ### Fixed Issues +* core + * [#4395](https://github.com/pmd/pmd/issues/4395): \[core] Support environment variable CLASSPATH with pmd.bat under Windows * java-errorprone * [#4393](https://github.com/pmd/pmd/issues/4393): \[java] MissingStaticMethodInNonInstantiatableClass false-positive for Lombok's @UtilityClass for classes with non-private fields diff --git a/pmd-dist/src/main/resources/scripts/pmd.bat b/pmd-dist/src/main/resources/scripts/pmd.bat index b3b2c78699..4c2023b8c8 100755 --- a/pmd-dist/src/main/resources/scripts/pmd.bat +++ b/pmd-dist/src/main/resources/scripts/pmd.bat @@ -2,5 +2,10 @@ set TOPDIR="%~dp0.." set OPTS= set MAIN_CLASS=net.sourceforge.pmd.PMD +set PMD_CLASSPATH=%TOPDIR%\lib\* -java %PMD_JAVA_OPTS% -classpath %TOPDIR%\lib\* %OPTS% %MAIN_CLASS% %* +if [%CLASSPATH%] NEQ [] ( + set PMD_CLASSPATH=%CLASSPATH%;%PMD_CLASSPATH% +) + +java %PMD_JAVA_OPTS% -classpath %PMD_CLASSPATH% %OPTS% %MAIN_CLASS% %* From 6c95689ed3a1d7a5d5ef0917d2139557ac2c0baf Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 9 Feb 2023 12:07:11 +0100 Subject: [PATCH 31/70] [core] Require explicit language versions (#4120) --- .../java/net/sourceforge/pmd/lang/LanguageModuleBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java index 8133d732fb..8d4c648666 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java @@ -290,7 +290,7 @@ public abstract class LanguageModuleBase implements Language { * @param aliases Additional names that are mapped to this version. Must contain no spaces. * * @throws NullPointerException If any parameter is null - * @throws IllegalArgumentException If the name or aliases contain spaces + * @throws IllegalArgumentException If the name or aliases are empty or contain spaces */ public LanguageMetadata addVersion(String name, String... aliases) { @@ -305,7 +305,7 @@ public abstract class LanguageModuleBase implements Language { * @param aliases Additional names that are mapped to this version. Must contain no spaces. * * @throws NullPointerException If any parameter is null - * @throws IllegalArgumentException If the name or aliases contain spaces + * @throws IllegalArgumentException If the name or aliases are empty or contain spaces */ public LanguageMetadata addDefaultVersion(String name, String... aliases) { versionMetadata.add(new LangVersionMetadata(name, Arrays.asList(aliases), true)); @@ -351,7 +351,7 @@ public abstract class LanguageModuleBase implements Language { } private static void checkVersionName(String name) { - if (SPACE_PAT.matcher(name).find()) { // TODO #4120 also check that the name is non-empty + if (StringUtils.isBlank(name) || SPACE_PAT.matcher(name).find()) { throw new IllegalArgumentException("Invalid version name: " + StringUtil.inSingleQuotes(name)); } } From d7d2ad541e835130678acf960927879c80140551 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 9 Feb 2023 12:15:43 +0100 Subject: [PATCH 32/70] Add explicit language versions (#4120) --- .../pmd/lang/apex/ApexLanguageModule.java | 19 ++++++++++--- .../pmd/lang/apex/LanguageVersionTest.java | 4 +-- .../pmd/lang/PlainTextLanguage.java | 4 ++- .../pmd/it/BinaryDistributionIT.java | 27 ++++++++++++++----- .../pmd/lang/html/HtmlLanguageModule.java | 4 ++- .../pmd/lang/html/LanguageVersionTest.java | 2 +- .../ecmascript/EcmascriptLanguageModule.java | 7 ++++- .../lang/ecmascript/ast/EcmascriptParser.java | 16 ++++++++--- .../lang/ecmascript/LanguageVersionTest.java | 2 +- .../pmd/lang/jsp/JspLanguageModule.java | 4 ++- .../pmd/lang/jsp/LanguageVersionTest.java | 2 +- .../pmd/lang/kotlin/KotlinLanguageModule.java | 4 +-- .../pmd/lang/kotlin/LanguageVersionTest.java | 4 +-- .../lang/modelica/ModelicaLanguageModule.java | 5 +++- .../lang/modelica/LanguageVersionTest.java | 2 +- .../pmd/lang/plsql/PLSQLLanguageModule.java | 8 +++++- .../pmd/lang/plsql/LanguageVersionTest.java | 2 +- .../pmd/lang/swift/SwiftLanguageModule.java | 13 ++++++++- .../pmd/lang/swift/LanguageVersionTest.java | 2 +- .../pmd/lang/vf/VfLanguageModule.java | 15 ++++++++--- .../pmd/lang/vf/LanguageVersionTest.java | 6 +++-- .../pmd/lang/vm/VmLanguageModule.java | 8 +++++- .../pmd/lang/vm/LanguageVersionTest.java | 2 +- .../pmd/lang/pom/PomLanguageModule.java | 5 +++- .../pmd/lang/wsdl/WsdlLanguageModule.java | 6 ++++- .../pmd/lang/xml/XmlLanguageModule.java | 6 ++++- .../pmd/lang/xsl/XslLanguageModule.java | 7 ++++- .../pmd/lang/xml/LanguageVersionTest.java | 8 +++--- .../sourceforge/pmd/ant/xml/pmdtasktest.xml | 2 +- 29 files changed, 146 insertions(+), 50 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java index 7b57934bd7..a5fca0cce0 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java @@ -4,22 +4,33 @@ package net.sourceforge.pmd.lang.apex; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageModuleBase; import net.sourceforge.pmd.lang.LanguageProcessor; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; -import apex.jorje.services.Version; - public class ApexLanguageModule extends LanguageModuleBase { public static final String NAME = "Apex"; public static final String TERSE_NAME = "apex"; + public static final List VERSIONS = listOf("52", "53", "54", "55", "56", "57"); + public ApexLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("cls", "trigger") - .addDefaultVersion(String.valueOf((int) Version.CURRENT.getExternal()))); + super(createMetadata()); + } + + private static LanguageMetadata createMetadata() { + LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("cls", "trigger"); + int lastVersion = VERSIONS.size() - 1; + VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); + languageMetadata.addDefaultVersion(VERSIONS.get(lastVersion)); + return languageMetadata; } @Override diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java index fe132bcb61..0379b1a16a 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/LanguageVersionTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(ApexLanguageModule.NAME, ApexLanguageModule.TERSE_NAME, "35", - getLanguage("Apex").getVersion("35"))); + return Arrays.asList(new TestDescriptor(ApexLanguageModule.NAME, ApexLanguageModule.TERSE_NAME, "57", + ApexLanguageModule.getInstance().getDefaultVersion())); } } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java index 29afc7d45d..3c14dd61de 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/PlainTextLanguage.java @@ -31,7 +31,9 @@ public final class PlainTextLanguage extends SimpleLanguageModuleBase { static final String TERSE_NAME = "text"; private PlainTextLanguage() { - super(LanguageMetadata.withId(TERSE_NAME).name("Plain text").extensions("plain-text-file-goo-extension"), + super(LanguageMetadata.withId(TERSE_NAME).name("Plain text") + .extensions("plain-text-file-goo-extension") + .addDefaultVersion("default"), new TextLvh()); } diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index cf6304f58a..46d3e81ac2 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -30,16 +30,29 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { + " kotlin, lua, matlab, modelica, objectivec, perl," + System.lineSeparator() + " php, plsql, python, ruby, scala, swift, tsql," + System.lineSeparator() + " vf, xml"; - SUPPORTED_LANGUAGES_PMD = "Valid values: apex-54, ecmascript-ES6, html-," + System.lineSeparator() - + " java-1.10, java-1.3, java-1.4, java-1.5, java-1." + System.lineSeparator() - + " 6, java-1.7, java-1.8, java-1.9, java-10," + System.lineSeparator() + SUPPORTED_LANGUAGES_PMD = "Valid values: apex-52, apex-53, apex-54, apex-55," + System.lineSeparator() + + " apex-56, apex-57, ecmascript-3, ecmascript-5," + System.lineSeparator() + + " ecmascript-6, ecmascript-7, ecmascript-8," + System.lineSeparator() + + " ecmascript-9, ecmascript-ES2015," + System.lineSeparator() + + " ecmascript-ES2016, ecmascript-ES2017," + System.lineSeparator() + + " ecmascript-ES2018, ecmascript-ES6, html-4," + System.lineSeparator() + + " html-5, java-1.10, java-1.3, java-1.4, java-1.5," + System.lineSeparator() + + " java-1.6, java-1.7, java-1.8, java-1.9, java-10," + System.lineSeparator() + " java-11, java-12, java-13, java-14, java-15," + System.lineSeparator() + " java-16, java-17, java-18, java-18-preview," + System.lineSeparator() + " java-19, java-19-preview, java-5, java-6, java-7," + System.lineSeparator() - + " java-8, java-9, jsp-, kotlin-1.6, kotlin-1." + System.lineSeparator() - + " 6-rfc+0.1, modelica-, plsql-, pom-, scala-2.10," + System.lineSeparator() - + " scala-2.11, scala-2.12, scala-2.13, swift-, vf-," + System.lineSeparator() - + " vm-, wsdl-, xml-, xsl-"; + + " java-8, java-9, jsp-2, jsp-3, kotlin-1.6," + System.lineSeparator() + + " kotlin-1.7, modelica-3.4, modelica-3.5," + System.lineSeparator() + + " plsql-11g, plsql-12.1, plsql-12.2," + System.lineSeparator() + + " plsql-12c_Release_1, plsql-12c_Release_2," + System.lineSeparator() + + " plsql-18c, plsql-19c, plsql-21c, pom-4.0.0," + System.lineSeparator() + + " scala-2.10, scala-2.11, scala-2.12, scala-2.13," + System.lineSeparator() + + " swift-4.2, swift-5.0, swift-5.1, swift-5.2," + System.lineSeparator() + + " swift-5.3, swift-5.4, swift-5.5, swift-5.6," + System.lineSeparator() + + " swift-5.7, vf-52, vf-53, vf-54, vf-55, vf-56," + System.lineSeparator() + + " vf-57, vm-2.0, vm-2.1, vm-2.2, vm-2.3, wsdl-1.1," + System.lineSeparator() + + " wsdl-2.0, xml-1.0, xml-1.1, xsl-1.0, xsl-2.0," + System.lineSeparator() + + " xsl-3.0"; } private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath(); 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 f242c180be..e93401e190 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 @@ -15,7 +15,9 @@ public final class HtmlLanguageModule extends SimpleLanguageModuleBase { public HtmlLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("html", "htm", "xhtml", "xht", "shtml"), + .extensions("html", "htm", "xhtml", "xht", "shtml") + .addVersion("4") + .addDefaultVersion("5"), new HtmlHandler()); } 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 c1baee0c98..3534875ac5 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 @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(HtmlLanguageModule.NAME, HtmlLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(HtmlLanguageModule.NAME, HtmlLanguageModule.TERSE_NAME, "5", getLanguage(HtmlLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java index e73a983d37..ea4ed73860 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java @@ -19,7 +19,12 @@ public class EcmascriptLanguageModule extends SimpleLanguageModuleBase { public EcmascriptLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("js") - .addDefaultVersion("ES6"), + .addVersion("3") + .addVersion("5") + .addVersion("6", "ES6", "ES2015") + .addVersion("7", "ES2016") + .addVersion("8", "ES2017") + .addDefaultVersion("9", "ES2018"), properties -> () -> new EcmascriptParser(properties)); } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.java index bb80c84d5b..6f6c00b5f8 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptParser.java @@ -18,6 +18,7 @@ import org.mozilla.javascript.ast.ErrorCollector; import org.mozilla.javascript.ast.ParseProblem; import net.sourceforge.pmd.lang.LanguagePropertyBundle; +import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.AstInfo; import net.sourceforge.pmd.lang.ast.FileAnalysisException; import net.sourceforge.pmd.lang.ast.ParseException; @@ -30,11 +31,11 @@ public final class EcmascriptParser implements net.sourceforge.pmd.lang.ast.Pars this.properties = properties; } - private AstRoot parseEcmascript(final String sourceCode, final List parseProblems) throws ParseException { + private AstRoot parseEcmascript(final String sourceCode, final LanguageVersion version, final List parseProblems) throws ParseException { final CompilerEnvirons compilerEnvirons = new CompilerEnvirons(); compilerEnvirons.setRecordingComments(true); compilerEnvirons.setRecordingLocalJsDocComments(true); - compilerEnvirons.setLanguageVersion(Context.VERSION_ES6); + compilerEnvirons.setLanguageVersion(determineRhinoLanguageVersion(version)); // Scope's don't appear to get set right without this compilerEnvirons.setIdeMode(true); compilerEnvirons.setWarnTrailingComma(true); @@ -52,10 +53,19 @@ public final class EcmascriptParser implements net.sourceforge.pmd.lang.ast.Pars return astRoot; } + private static int determineRhinoLanguageVersion(LanguageVersion version) { + switch (version.getVersion()) { + case "3": return Context.VERSION_1_5; + case "5": return Context.VERSION_1_8; + default: return Context.VERSION_ES6; + } + } + @Override public RootNode parse(ParserTask task) throws FileAnalysisException { + final LanguageVersion version = task.getLanguageVersion(); final List parseProblems = new ArrayList<>(); - final AstRoot astRoot = parseEcmascript(task.getSourceText(), parseProblems); + final AstRoot astRoot = parseEcmascript(task.getSourceText(), version, parseProblems); final EcmascriptTreeBuilder treeBuilder = new EcmascriptTreeBuilder(parseProblems); ASTAstRoot tree = (ASTAstRoot) treeBuilder.build(astRoot); 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 5df250aff5..73a35e13db 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 @@ -13,7 +13,7 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { return Arrays.asList( - new TestDescriptor(EcmascriptLanguageModule.NAME, EcmascriptLanguageModule.TERSE_NAME, "ES6", + new TestDescriptor(EcmascriptLanguageModule.NAME, EcmascriptLanguageModule.TERSE_NAME, "9", getLanguage(EcmascriptLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java index 573a42b94c..d36076551d 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java @@ -16,7 +16,9 @@ public class JspLanguageModule extends SimpleLanguageModuleBase { public JspLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME).shortName("JSP") - .extensions("jsp", "jspx", "jspf", "tag"), + .extensions("jsp", "jspx", "jspf", "tag") + .addVersion("2") + .addDefaultVersion("3"), new JspHandler()); } 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 4707c22101..ed81a65e96 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 @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(JspLanguageModule.NAME, JspLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(JspLanguageModule.NAME, JspLanguageModule.TERSE_NAME, "3", getLanguage(JspLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java index 31e0d209d4..d82342bc4e 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java @@ -25,8 +25,8 @@ public class KotlinLanguageModule extends SimpleLanguageModuleBase { */ public KotlinLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("kt", "ktm") - .addDefaultVersion("1.6-rfc+0.1", "1.6"), + .addVersion("1.6") + .addDefaultVersion("1.7"), new KotlinHandler()); - } } diff --git a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java index 9417c8b537..5a6956aa8e 100644 --- a/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java +++ b/pmd-kotlin/src/test/java/net/sourceforge/pmd/lang/kotlin/LanguageVersionTest.java @@ -13,9 +13,7 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { return Arrays.asList( - new TestDescriptor(KotlinLanguageModule.NAME, KotlinLanguageModule.TERSE_NAME, "1.6-rfc+0.1", - getLanguage(KotlinLanguageModule.NAME).getDefaultVersion()), - new TestDescriptor(KotlinLanguageModule.NAME, KotlinLanguageModule.TERSE_NAME, "1.6", + new TestDescriptor(KotlinLanguageModule.NAME, KotlinLanguageModule.TERSE_NAME, "1.7", getLanguage(KotlinLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java index 2746c21363..290533ba0d 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java @@ -11,7 +11,10 @@ public class ModelicaLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "modelica"; public ModelicaLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("mo"), + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("mo") + .addVersion("3.4") + .addDefaultVersion("3.5"), new ModelicaHandler()); } diff --git a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java index 367e843585..f06c1c8a1a 100644 --- a/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java +++ b/pmd-modelica/src/test/java/net/sourceforge/pmd/lang/modelica/LanguageVersionTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(ModelicaLanguageModule.NAME, ModelicaLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(ModelicaLanguageModule.NAME, ModelicaLanguageModule.TERSE_NAME, "3.5", getLanguage(ModelicaLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java index 0b74d631c2..6422362df0 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java @@ -27,7 +27,13 @@ public class PLSQLLanguageModule extends SimpleLanguageModuleBase { "pck", "pks", "pkh", "pkb", // Packages "typ", "tyb", // Object Types "tps", "tpb" // Object Types - ), + ) + .addVersion("11g") + .addVersion("12c_Release_1", "12.1") + .addVersion("12c_Release_2", "12.2") + .addVersion("18c") + .addVersion("19c") + .addDefaultVersion("21c"), new PLSQLHandler() ); } diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java index f28d58964e..886b4c5fe5 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/LanguageVersionTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(PLSQLLanguageModule.NAME, PLSQLLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(PLSQLLanguageModule.NAME, PLSQLLanguageModule.TERSE_NAME, "21c", getLanguage(PLSQLLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java index 1b05e94b4b..5e94c303f0 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java @@ -20,6 +20,17 @@ public class SwiftLanguageModule extends SimpleLanguageModuleBase { * Create a new instance of Swift Language Module. */ public SwiftLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("swift"), new SwiftHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("swift") + .addVersion("4.2") + .addVersion("5.0") + .addVersion("5.1") + .addVersion("5.2") + .addVersion("5.3") + .addVersion("5.4") + .addVersion("5.5") + .addVersion("5.6") + .addDefaultVersion("5.7"), + new SwiftHandler()); } } diff --git a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java index e56e9f3ca9..9f5302ba72 100644 --- a/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java +++ b/pmd-swift/src/test/java/net/sourceforge/pmd/lang/swift/LanguageVersionTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(SwiftLanguageModule.NAME, SwiftLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(SwiftLanguageModule.NAME, SwiftLanguageModule.TERSE_NAME, "5.7", getLanguage(SwiftLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java index b75d9ffba6..3223c311d2 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java @@ -20,12 +20,21 @@ public class VfLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "vf"; public VfLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("page", "component") - .dependsOnLanguage(ApexLanguageModule.TERSE_NAME), + super(createMetdata(), p -> new VfHandler((VfLanguageProperties) p)); } + private static LanguageMetadata createMetdata() { + LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("page", "component") + .dependsOnLanguage(ApexLanguageModule.TERSE_NAME); + // use the same versions as in Apex + int lastVersion = ApexLanguageModule.VERSIONS.size() - 1; + ApexLanguageModule.VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); + languageMetadata.addDefaultVersion(ApexLanguageModule.VERSIONS.get(lastVersion)); + return languageMetadata; + } + @Override public LanguagePropertyBundle newPropertyBundle() { return new VfLanguageProperties(); diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java index 141d62ed8c..38c68b028a 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/LanguageVersionTest.java @@ -8,11 +8,13 @@ import java.util.Arrays; import java.util.Collection; import net.sourceforge.pmd.AbstractLanguageVersionTest; +import net.sourceforge.pmd.lang.apex.ApexLanguageModule; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(VfLanguageModule.NAME, VfLanguageModule.TERSE_NAME, "", - getLanguage(VfLanguageModule.NAME).getDefaultVersion())); + return Arrays.asList(new TestDescriptor(VfLanguageModule.NAME, VfLanguageModule.TERSE_NAME, + ApexLanguageModule.getInstance().getDefaultVersion().getVersion(), + getLanguage(VfLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java index 553fb8a4e8..0cc028c236 100644 --- a/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java +++ b/pmd-vm/src/main/java/net/sourceforge/pmd/lang/vm/VmLanguageModule.java @@ -15,7 +15,13 @@ public class VmLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "vm"; public VmLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("vm"), new VmHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("vm") + .addVersion("2.0") + .addVersion("2.1") + .addVersion("2.2") + .addDefaultVersion("2.3"), + new VmHandler()); } } diff --git a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java index 2e5645fc11..32f4877901 100644 --- a/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java +++ b/pmd-vm/src/test/java/net/sourceforge/pmd/lang/vm/LanguageVersionTest.java @@ -12,7 +12,7 @@ import net.sourceforge.pmd.AbstractLanguageVersionTest; class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { - return Arrays.asList(new TestDescriptor(VmLanguageModule.NAME, VmLanguageModule.TERSE_NAME, "", + return Arrays.asList(new TestDescriptor(VmLanguageModule.NAME, VmLanguageModule.TERSE_NAME, "2.3", getLanguage(VmLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java index 7de4d4da0b..9f91051657 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/pom/PomLanguageModule.java @@ -12,7 +12,10 @@ public class PomLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "pom"; public PomLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("pom"), new XmlHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("pom") + .addDefaultVersion("4.0.0"), + new XmlHandler()); } } diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java index ed9512d1cb..f48d4c9ddd 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/wsdl/WsdlLanguageModule.java @@ -15,7 +15,11 @@ public class WsdlLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "wsdl"; public WsdlLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("wsdl"), new XmlHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("wsdl") + .addVersion("1.1") + .addDefaultVersion("2.0"), + new XmlHandler()); } } diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java index 5df4a35b06..21bf0e22bc 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java @@ -15,6 +15,10 @@ public class XmlLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "xml"; public XmlLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("xml"), new XmlHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("xml") + .addVersion("1.0") + .addDefaultVersion("1.1"), + new XmlHandler()); } } diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java index c51c48096a..ce0b833b44 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xsl/XslLanguageModule.java @@ -16,7 +16,12 @@ public class XslLanguageModule extends SimpleLanguageModuleBase { public static final String TERSE_NAME = "xsl"; public XslLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("xsl", "xslt"), new XmlHandler()); + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions("xsl", "xslt") + .addVersion("1.0") + .addVersion("2.0") + .addDefaultVersion("3.0"), + new XmlHandler()); } } diff --git a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java index 4e4816f7fb..0654616943 100644 --- a/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java +++ b/pmd-xml/src/test/java/net/sourceforge/pmd/lang/xml/LanguageVersionTest.java @@ -16,13 +16,13 @@ class LanguageVersionTest extends AbstractLanguageVersionTest { static Collection data() { return Arrays.asList( - new TestDescriptor(XmlLanguageModule.NAME, XmlLanguageModule.TERSE_NAME, "", + new TestDescriptor(XmlLanguageModule.NAME, XmlLanguageModule.TERSE_NAME, "1.1", getLanguage(XmlLanguageModule.NAME).getDefaultVersion()), - new TestDescriptor(XslLanguageModule.NAME, XslLanguageModule.TERSE_NAME, "", + new TestDescriptor(XslLanguageModule.NAME, XslLanguageModule.TERSE_NAME, "3.0", getLanguage(XslLanguageModule.NAME).getDefaultVersion()), - new TestDescriptor(WsdlLanguageModule.NAME, WsdlLanguageModule.TERSE_NAME, "", + new TestDescriptor(WsdlLanguageModule.NAME, WsdlLanguageModule.TERSE_NAME, "2.0", getLanguage(WsdlLanguageModule.NAME).getDefaultVersion()), - new TestDescriptor(PomLanguageModule.NAME, PomLanguageModule.TERSE_NAME, "", + new TestDescriptor(PomLanguageModule.NAME, PomLanguageModule.TERSE_NAME, "4.0.0", getLanguage(PomLanguageModule.NAME).getDefaultVersion())); } } diff --git a/pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml b/pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml index 52ba35fc8c..db7406fb77 100644 --- a/pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml +++ b/pmd-xml/src/test/resources/net/sourceforge/pmd/ant/xml/pmdtasktest.xml @@ -7,7 +7,7 @@ - + From e2bb0c8480e74cc765166969841c1c941368e60a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 9 Feb 2023 17:17:37 +0100 Subject: [PATCH 33/70] Reuse names and extensions for CPD language --- docs/_data/sidebars/pmd_sidebar.yml | 36 ++++++++--------- .../net/sourceforge/pmd/cpd/ApexLanguage.java | 4 +- .../pmd/lang/apex/ApexLanguageModule.java | 7 +++- .../sourceforge/pmd/cpd/AbstractLanguage.java | 17 +++++++- .../test/resources/expected/pmd_sidebar.yml | 18 ++++----- .../net/sourceforge/pmd/docs/sidebar.yml | 24 ++++++------ .../pmd/lang/html/HtmlCpdLanguage.java | 2 +- .../pmd/lang/html/HtmlLanguageModule.java | 10 ++++- .../net/sourceforge/pmd/cpd/JavaLanguage.java | 4 +- .../pmd/lang/java/JavaLanguageModule.java | 9 ++++- .../pmd/cpd/EcmascriptLanguage.java | 5 ++- .../ecmascript/EcmascriptLanguageModule.java | 11 +++++- .../net/sourceforge/pmd/cpd/JSPLanguage.java | 4 +- .../pmd/lang/jsp/JspLanguageModule.java | 9 ++++- .../sourceforge/pmd/cpd/KotlinLanguage.java | 4 +- .../pmd/lang/kotlin/KotlinLanguageModule.java | 10 ++++- .../sourceforge/pmd/cpd/ModelicaLanguage.java | 2 +- .../lang/modelica/ModelicaLanguageModule.java | 9 ++++- .../sourceforge/pmd/cpd/PLSQLLanguage.java | 13 ++----- .../pmd/lang/plsql/PLSQLLanguageModule.java | 39 +++++++++++-------- .../sourceforge/pmd/cpd/ScalaLanguage.java | 4 +- .../pmd/lang/scala/ScalaLanguageModule.java | 9 ++++- .../sourceforge/pmd/cpd/SwiftLanguage.java | 4 +- .../pmd/lang/swift/SwiftLanguageModule.java | 10 ++++- .../net/sourceforge/pmd/cpd/VfLanguage.java | 4 +- .../pmd/lang/vf/VfLanguageModule.java | 10 ++++- .../pmd/lang/xml/XmlLanguageModule.java | 9 ++++- .../sourceforge/pmd/xml/cpd/XmlLanguage.java | 3 +- 28 files changed, 198 insertions(+), 92 deletions(-) diff --git a/docs/_data/sidebars/pmd_sidebar.yml b/docs/_data/sidebars/pmd_sidebar.yml index 376df38be3..f0a57382be 100644 --- a/docs/_data/sidebars/pmd_sidebar.yml +++ b/docs/_data/sidebars/pmd_sidebar.yml @@ -160,24 +160,6 @@ entries: - title: Security output: web, pdf url: /pmd_rules_apex_security.html - - title: null - output: web, pdf - subfolders: - - title: Ecmascript Rules - output: web, pdf - subfolderitems: - - title: Index - output: web, pdf - url: /pmd_rules_ecmascript.html - - title: Best Practices - output: web, pdf - url: /pmd_rules_ecmascript_bestpractices.html - - title: Code Style - output: web, pdf - url: /pmd_rules_ecmascript_codestyle.html - - title: Error Prone - output: web, pdf - url: /pmd_rules_ecmascript_errorprone.html - title: null output: web, pdf subfolders: @@ -247,6 +229,24 @@ entries: - title: Security output: web, pdf url: /pmd_rules_jsp_security.html + - title: null + output: web, pdf + subfolders: + - title: JavaScript Rules + output: web, pdf + subfolderitems: + - title: Index + output: web, pdf + url: /pmd_rules_ecmascript.html + - title: Best Practices + output: web, pdf + url: /pmd_rules_ecmascript_bestpractices.html + - title: Code Style + output: web, pdf + url: /pmd_rules_ecmascript_codestyle.html + - title: Error Prone + output: web, pdf + url: /pmd_rules_ecmascript_errorprone.html - title: null output: web, pdf subfolders: diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/cpd/ApexLanguage.java b/pmd-apex/src/main/java/net/sourceforge/pmd/cpd/ApexLanguage.java index 0bb7bd7014..5ca6959052 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/cpd/ApexLanguage.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/cpd/ApexLanguage.java @@ -6,6 +6,8 @@ package net.sourceforge.pmd.cpd; import java.util.Properties; +import net.sourceforge.pmd.lang.apex.ApexLanguageModule; + public class ApexLanguage extends AbstractLanguage { public ApexLanguage() { @@ -13,7 +15,7 @@ public class ApexLanguage extends AbstractLanguage { } public ApexLanguage(Properties properties) { - super("Apex", "apex", new ApexTokenizer(), ".cls"); + super(ApexLanguageModule.NAME, ApexLanguageModule.TERSE_NAME, new ApexTokenizer(), ApexLanguageModule.EXTENSIONS); setProperties(properties); } diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java index a5fca0cce0..33c9f5b0d6 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java @@ -8,6 +8,7 @@ import static net.sourceforge.pmd.util.CollectionUtil.listOf; import java.util.List; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageModuleBase; import net.sourceforge.pmd.lang.LanguageProcessor; @@ -19,14 +20,18 @@ public class ApexLanguageModule extends LanguageModuleBase { public static final String NAME = "Apex"; public static final String TERSE_NAME = "apex"; + @InternalApi public static final List VERSIONS = listOf("52", "53", "54", "55", "56", "57"); + @InternalApi + public static final List EXTENSIONS = listOf("cls", "trigger"); public ApexLanguageModule() { super(createMetadata()); } private static LanguageMetadata createMetadata() { - LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("cls", "trigger"); + LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME); + languageMetadata.extensions(EXTENSIONS.get(0), EXTENSIONS.subList(0, EXTENSIONS.size()).toArray(new String[0])); int lastVersion = VERSIONS.size() - 1; VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); languageMetadata.addDefaultVersion(VERSIONS.get(lastVersion)); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java index 7e08eccf8a..4045ddbf16 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/AbstractLanguage.java @@ -11,6 +11,7 @@ import java.util.Arrays; import java.util.List; import java.util.Properties; import java.util.function.Predicate; +import java.util.stream.Collectors; import net.sourceforge.pmd.internal.util.PredicateUtil; @@ -22,11 +23,23 @@ public abstract class AbstractLanguage implements Language { private final List extensions; public AbstractLanguage(String name, String terseName, Tokenizer tokenizer, String... extensions) { + this(name, terseName, tokenizer, Arrays.asList(extensions)); + } + + protected AbstractLanguage(String name, String terseName, Tokenizer tokenizer, List extensions) { this.name = name; this.terseName = terseName; this.tokenizer = tokenizer; - this.fileFilter = PredicateUtil.toNormalizedFileFilter(PredicateUtil.getFileExtensionFilter(extensions).or(it -> Files.isDirectory(Paths.get(it)))); - this.extensions = Arrays.asList(extensions); + List extensionsWithDot = extensions.stream().map(e -> { + if (e.length() > 0 && e.charAt(0) != '.') { + return "." + e; + } + return e; + }).collect(Collectors.toList()); + this.fileFilter = PredicateUtil.toNormalizedFileFilter( + PredicateUtil.getFileExtensionFilter(extensionsWithDot.toArray(new String[0])) + .or(it -> Files.isDirectory(Paths.get(it)))); + this.extensions = extensionsWithDot; } @Override diff --git a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml index b7ce41869c..685cfc5851 100644 --- a/pmd-doc/src/test/resources/expected/pmd_sidebar.yml +++ b/pmd-doc/src/test/resources/expected/pmd_sidebar.yml @@ -15,15 +15,6 @@ entries: - title: Index output: web, pdf url: /pmd_rules_apex.html - - title: null - output: web, pdf - subfolders: - - title: Ecmascript Rules - output: web, pdf - subfolderitems: - - title: Index - output: web, pdf - url: /pmd_rules_ecmascript.html - title: null output: web, pdf subfolders: @@ -54,6 +45,15 @@ entries: - title: Index output: web, pdf url: /pmd_rules_jsp.html + - title: null + output: web, pdf + subfolders: + - title: JavaScript Rules + output: web, pdf + subfolderitems: + - title: Index + output: web, pdf + url: /pmd_rules_ecmascript.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/docs/sidebar.yml index 69435aad61..0b8bcc1128 100644 --- a/pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml +++ b/pmd-doc/src/test/resources/net/sourceforge/pmd/docs/sidebar.yml @@ -1,15 +1,3 @@ -- title: null - output: web, pdf - subfolders: - - title: Ecmascript Rules - output: web, pdf - subfolderitems: - - title: Index - output: web, pdf - url: /pmd_rules_ecmascript.html - - title: test - output: web, pdf - url: /pmd_rules_ecmascript_bestpractices.html - title: null output: web, pdf subfolders: @@ -25,6 +13,18 @@ - title: test2 output: web, pdf url: /pmd_rules_java_codestyle.html +- title: null + output: web, pdf + subfolders: + - title: JavaScript Rules + output: web, pdf + subfolderitems: + - title: Index + output: web, pdf + url: /pmd_rules_ecmascript.html + - title: test + output: web, pdf + url: /pmd_rules_ecmascript_bestpractices.html - title: null output: web, pdf subfolders: diff --git a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlCpdLanguage.java b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlCpdLanguage.java index 3c6c0fdbde..740acfff6b 100644 --- a/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlCpdLanguage.java +++ b/pmd-html/src/main/java/net/sourceforge/pmd/lang/html/HtmlCpdLanguage.java @@ -11,6 +11,6 @@ import net.sourceforge.pmd.lang.html.ast.HtmlTokenizer; public final class HtmlCpdLanguage extends AbstractLanguage { public HtmlCpdLanguage() { - super("HTML", "html", new HtmlTokenizer(), ".html"); + super(HtmlLanguageModule.NAME, HtmlLanguageModule.TERSE_NAME, new HtmlTokenizer(), HtmlLanguageModule.EXTENSIONS); } } 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 e93401e190..0743f248b9 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 @@ -2,9 +2,13 @@ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ - package net.sourceforge.pmd.lang.html; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; @@ -12,10 +16,12 @@ public final class HtmlLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "HTML"; public static final String TERSE_NAME = "html"; + @InternalApi + public static final List EXTENSIONS = listOf("html", "htm", "xhtml", "xht", "shtml"); public HtmlLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("html", "htm", "xhtml", "xht", "shtml") + .extensions(EXTENSIONS.get(0), EXTENSIONS.subList(0, EXTENSIONS.size()).toArray(new String[0])) .addVersion("4") .addDefaultVersion("5"), new HtmlHandler()); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java b/pmd-java/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java index 0ff3638c99..2a68ea48a5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/cpd/JavaLanguage.java @@ -6,13 +6,15 @@ package net.sourceforge.pmd.cpd; import java.util.Properties; +import net.sourceforge.pmd.lang.java.JavaLanguageModule; + public class JavaLanguage extends AbstractLanguage { public JavaLanguage() { this(System.getProperties()); } public JavaLanguage(Properties properties) { - super("Java", "java", new JavaTokenizer(), ".java"); + super(JavaLanguageModule.NAME, JavaLanguageModule.TERSE_NAME, new JavaTokenizer(), JavaLanguageModule.EXTENSIONS); setProperties(properties); } 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 4bd8bbde05..bc3658ea79 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 @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.java; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageModuleBase; import net.sourceforge.pmd.lang.LanguageProcessor; @@ -19,9 +24,11 @@ public class JavaLanguageModule extends LanguageModuleBase { public static final String NAME = "Java"; public static final String TERSE_NAME = "java"; + @InternalApi + public static final List EXTENSIONS = listOf("java"); public JavaLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("java") + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0)) .addVersion("1.3") .addVersion("1.4") .addVersion("1.5", "5") diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java index 2ad5fd6f41..e7edb068fd 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/cpd/EcmascriptLanguage.java @@ -4,12 +4,15 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.ecmascript.EcmascriptLanguageModule; + /** * * @author Zev Blut zb@ubit.com */ public class EcmascriptLanguage extends AbstractLanguage { public EcmascriptLanguage() { - super("JavaScript", "ecmascript", new EcmascriptTokenizer(), ".js"); + super(EcmascriptLanguageModule.NAME, EcmascriptLanguageModule.TERSE_NAME, new EcmascriptTokenizer(), + EcmascriptLanguageModule.EXTENSIONS); } } diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java index ea4ed73860..e8c56f48c3 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.ecmascript; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptParser; @@ -14,11 +19,13 @@ import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; */ public class EcmascriptLanguageModule extends SimpleLanguageModuleBase { - public static final String NAME = "Ecmascript"; + public static final String NAME = "JavaScript"; public static final String TERSE_NAME = "ecmascript"; + @InternalApi + public static final List EXTENSIONS = listOf("js"); public EcmascriptLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("js") + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0)) .addVersion("3") .addVersion("5") .addVersion("6", "ES6", "ES2015") diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java index c4c480cecc..26b2ef171d 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/cpd/JSPLanguage.java @@ -4,8 +4,10 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.jsp.JspLanguageModule; + public class JSPLanguage extends AbstractLanguage { public JSPLanguage() { - super("JSP", "jsp", new JSPTokenizer(), ".jsp", ".jspx", ".jspf", ".tag"); + super(JspLanguageModule.NAME, JspLanguageModule.TERSE_NAME, new JSPTokenizer(), JspLanguageModule.EXTENSIONS); } } diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java index d36076551d..33fb67c449 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.jsp; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; /** @@ -13,10 +18,12 @@ public class JspLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "Java Server Pages"; public static final String TERSE_NAME = "jsp"; + @InternalApi + public static final List EXTENSIONS = listOf("jsp", "jspx", "jspf", "tag"); public JspLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME).shortName("JSP") - .extensions("jsp", "jspx", "jspf", "tag") + .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) .addVersion("2") .addDefaultVersion("3"), new JspHandler()); diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/cpd/KotlinLanguage.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/cpd/KotlinLanguage.java index 4a14aa766f..1ec0e63349 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/cpd/KotlinLanguage.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/cpd/KotlinLanguage.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.kotlin.KotlinLanguageModule; + /** * Language implementation for Kotlin */ @@ -13,6 +15,6 @@ public class KotlinLanguage extends AbstractLanguage { * Creates a new Kotlin Language instance. */ public KotlinLanguage() { - super("Kotlin", "kotlin", new KotlinTokenizer(), ".kt"); + super(KotlinLanguageModule.NAME, KotlinLanguageModule.TERSE_NAME, new KotlinTokenizer(), KotlinLanguageModule.EXTENSIONS); } } diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java index d82342bc4e..1bdaa924c7 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java @@ -4,7 +4,12 @@ package net.sourceforge.pmd.lang.kotlin; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + import net.sourceforge.pmd.annotation.Experimental; +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; /** @@ -20,11 +25,14 @@ public class KotlinLanguageModule extends SimpleLanguageModuleBase { /** The terse name. */ public static final String TERSE_NAME = "kotlin"; + @InternalApi + public static final List EXTENSIONS = listOf("kt", "ktm"); + /** * Create a new instance of Kotlin Language Module. */ public KotlinLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("kt", "ktm") + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) .addVersion("1.6") .addDefaultVersion("1.7"), new KotlinHandler()); diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/cpd/ModelicaLanguage.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/cpd/ModelicaLanguage.java index 53852955e5..c7c5a58b2c 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/cpd/ModelicaLanguage.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/cpd/ModelicaLanguage.java @@ -8,6 +8,6 @@ import net.sourceforge.pmd.lang.modelica.ModelicaLanguageModule; public class ModelicaLanguage extends AbstractLanguage { public ModelicaLanguage() { - super(ModelicaLanguageModule.NAME, ModelicaLanguageModule.TERSE_NAME, new ModelicaTokenizer(), ".mo"); + super(ModelicaLanguageModule.NAME, ModelicaLanguageModule.TERSE_NAME, new ModelicaTokenizer(), ModelicaLanguageModule.EXTENSIONS); } } diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java index 290533ba0d..e0c6863a8b 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java @@ -4,15 +4,22 @@ package net.sourceforge.pmd.lang.modelica; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; public class ModelicaLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "Modelica"; public static final String TERSE_NAME = "modelica"; + @InternalApi + public static final List EXTENSIONS = listOf("mo"); public ModelicaLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("mo") + .extensions(EXTENSIONS.get(0)) .addVersion("3.4") .addDefaultVersion("3.5"), new ModelicaHandler()); diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/cpd/PLSQLLanguage.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/cpd/PLSQLLanguage.java index 5331ec9f72..3a744e12ae 100755 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/cpd/PLSQLLanguage.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/cpd/PLSQLLanguage.java @@ -6,22 +6,15 @@ package net.sourceforge.pmd.cpd; import java.util.Properties; +import net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule; + /** * * @author Stuart Turton sturton@users.sourceforge.net */ public class PLSQLLanguage extends AbstractLanguage { public PLSQLLanguage() { - super("PL/SQL", "plsql", new PLSQLTokenizer(), - ".sql", - ".trg", // Triggers - ".prc", ".fnc", // Standalone Procedures and Functions - ".pld", // Oracle*Forms - ".pls", ".plh", ".plb", // Packages - ".pck", ".pks", ".pkh", ".pkb", // Packages - ".typ", ".tyb", // Object Types - ".tps", ".tpb" // Object Types - ); + super(PLSQLLanguageModule.NAME, PLSQLLanguageModule.TERSE_NAME, new PLSQLTokenizer(), PLSQLLanguageModule.EXTENSIONS); } @Override diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java index 6422362df0..01f262ac4b 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.plsql; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; /** @@ -13,27 +18,29 @@ public class PLSQLLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "PLSQL"; public static final String TERSE_NAME = "plsql"; + @InternalApi + public static final List EXTENSIONS = listOf( + "sql", + "trg", // Triggers + "prc", "fnc", // Standalone Procedures and Functions + "pld", // Oracle*Forms + "pls", "plh", "plb", // Packages + "pck", "pks", "pkh", "pkb", // Packages + "typ", "tyb", // Object Types + "tps", "tpb" // Object Types + ); public PLSQLLanguageModule() { super( LanguageMetadata.withId(TERSE_NAME) .name(NAME) - .extensions( - "sql", - "trg", // Triggers - "prc", "fnc", // Standalone Procedures and Functions - "pld", // Oracle*Forms - "pls", "plh", "plb", // Packages - "pck", "pks", "pkh", "pkb", // Packages - "typ", "tyb", // Object Types - "tps", "tpb" // Object Types - ) - .addVersion("11g") - .addVersion("12c_Release_1", "12.1") - .addVersion("12c_Release_2", "12.2") - .addVersion("18c") - .addVersion("19c") - .addDefaultVersion("21c"), + .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) + .addVersion("11g") + .addVersion("12c_Release_1", "12.1") + .addVersion("12c_Release_2", "12.2") + .addVersion("18c") + .addVersion("19c") + .addDefaultVersion("21c"), new PLSQLHandler() ); } diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaLanguage.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaLanguage.java index fd1f1b6da9..fe1e4c6f03 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaLanguage.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/cpd/ScalaLanguage.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.scala.ScalaLanguageModule; + /** * Language implementation for Scala. */ @@ -13,6 +15,6 @@ public class ScalaLanguage extends AbstractLanguage { * Creates a new Scala Language instance. */ public ScalaLanguage() { - super("Scala", "scala", new ScalaTokenizer(), ".scala"); + super(ScalaLanguageModule.NAME, ScalaLanguageModule.TERSE_NAME, new ScalaTokenizer(), ScalaLanguageModule.EXTENSIONS); } } diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java index 1825eec5c6..6bfa00c615 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java @@ -4,6 +4,10 @@ package net.sourceforge.pmd.lang.scala; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.annotation.InternalApi; @@ -24,11 +28,14 @@ public class ScalaLanguageModule extends SimpleLanguageModuleBase { /** The terse name. */ public static final String TERSE_NAME = "scala"; + @InternalApi + public static final List EXTENSIONS = listOf("scala"); + /** * Create a new instance of Scala Language Module. */ public ScalaLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("scala") + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0)) .addVersion("2.10") .addVersion("2.11") .addVersion("2.12") diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/cpd/SwiftLanguage.java b/pmd-swift/src/main/java/net/sourceforge/pmd/cpd/SwiftLanguage.java index 841e0861fd..297f27cf24 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/cpd/SwiftLanguage.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/cpd/SwiftLanguage.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.swift.SwiftLanguageModule; + /** * Language implementation for Swift */ @@ -13,6 +15,6 @@ public class SwiftLanguage extends AbstractLanguage { * Creates a new Swift Language instance. */ public SwiftLanguage() { - super("Swift", "swift", new SwiftTokenizer(), ".swift"); + super(SwiftLanguageModule.NAME, SwiftLanguageModule.TERSE_NAME, new SwiftTokenizer(), SwiftLanguageModule.EXTENSIONS); } } diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java index 5e94c303f0..ac2daf61a5 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.swift; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; /** @@ -16,12 +21,15 @@ public class SwiftLanguageModule extends SimpleLanguageModuleBase { /** The terse name. */ public static final String TERSE_NAME = "swift"; + @InternalApi + public static final List EXTENSIONS = listOf("swift"); + /** * Create a new instance of Swift Language Module. */ public SwiftLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("swift") + .extensions(EXTENSIONS.get(0)) .addVersion("4.2") .addVersion("5.0") .addVersion("5.1") diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfLanguage.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfLanguage.java index 301bfc15c3..5551e91a5d 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfLanguage.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/cpd/VfLanguage.java @@ -4,12 +4,14 @@ package net.sourceforge.pmd.cpd; +import net.sourceforge.pmd.lang.vf.VfLanguageModule; + /** * @author sergey.gorbaty * */ public class VfLanguage extends AbstractLanguage { public VfLanguage() { - super("VisualForce", "vf", new VfTokenizer(), ".page", ".component"); + super(VfLanguageModule.NAME, VfLanguageModule.TERSE_NAME, new VfTokenizer(), VfLanguageModule.EXTENSIONS); } } diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java index 3223c311d2..74f8596ea5 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java @@ -4,13 +4,17 @@ package net.sourceforge.pmd.lang.vf; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; - /** * @author sergey.gorbaty */ @@ -18,6 +22,8 @@ public class VfLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "Salesforce VisualForce"; public static final String TERSE_NAME = "vf"; + @InternalApi + public static final List EXTENSIONS = listOf("page", "component"); public VfLanguageModule() { super(createMetdata(), @@ -26,7 +32,7 @@ public class VfLanguageModule extends SimpleLanguageModuleBase { private static LanguageMetadata createMetdata() { LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("page", "component") + .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) .dependsOnLanguage(ApexLanguageModule.TERSE_NAME); // use the same versions as in Apex int lastVersion = ApexLanguageModule.VERSIONS.size() - 1; diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java index 21bf0e22bc..838fac01d0 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java @@ -4,6 +4,11 @@ package net.sourceforge.pmd.lang.xml; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; + +import java.util.List; + +import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; /** @@ -13,10 +18,12 @@ public class XmlLanguageModule extends SimpleLanguageModuleBase { public static final String NAME = "XML"; public static final String TERSE_NAME = "xml"; + @InternalApi + public static final List EXTENSIONS = listOf("xml"); public XmlLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions("xml") + .extensions(EXTENSIONS.get(0)) .addVersion("1.0") .addDefaultVersion("1.1"), new XmlHandler()); diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/xml/cpd/XmlLanguage.java b/pmd-xml/src/main/java/net/sourceforge/pmd/xml/cpd/XmlLanguage.java index 38b38c8eb3..c5c849a248 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/xml/cpd/XmlLanguage.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/xml/cpd/XmlLanguage.java @@ -5,10 +5,11 @@ package net.sourceforge.pmd.xml.cpd; import net.sourceforge.pmd.cpd.AbstractLanguage; +import net.sourceforge.pmd.lang.xml.XmlLanguageModule; public class XmlLanguage extends AbstractLanguage { public XmlLanguage() { - super("Xml", "xml", new XmlTokenizer(), ".xml"); + super(XmlLanguageModule.NAME, XmlLanguageModule.TERSE_NAME, new XmlTokenizer(), XmlLanguageModule.EXTENSIONS); } } From ee3f08a498bfc1cbb5da0d26f03f9643f564a110 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 9 Feb 2023 18:18:56 +0100 Subject: [PATCH 34/70] [doc] Update release notes regarding ecmascript version --- docs/pages/7_0_0_release_notes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/7_0_0_release_notes.md b/docs/pages/7_0_0_release_notes.md index 86c89181b6..b82e539b7d 100644 --- a/docs/pages/7_0_0_release_notes.md +++ b/docs/pages/7_0_0_release_notes.md @@ -153,9 +153,9 @@ See {% jdoc core::lang.ast.NodeStream %} for more details. #### JavaScript support The JS specific parser options have been removed. The parser now always retains comments and uses version ES6. -The language module registers only one version (as before), now correctly with version "ES6" instead of "3". -Since there is only one version available for JavaScript there is actually no need to selected a specific version. -The default version is always ES6. +The language module registers a couple of different versions. The latest version, which supports ES6 and also some +new constructs (see [Rhino](https://github.com/mozilla/rhino)]), is the default. This should be fine for most +use cases. #### New Rules From 8aaef01ed8f2972e82353350ece96aa634c7b201 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 9 Feb 2023 17:58:58 +0100 Subject: [PATCH 35/70] [doc] Update release notes (#4120) [skip ci] --- docs/pages/7_0_0_release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/7_0_0_release_notes.md b/docs/pages/7_0_0_release_notes.md index b82e539b7d..2d877db318 100644 --- a/docs/pages/7_0_0_release_notes.md +++ b/docs/pages/7_0_0_release_notes.md @@ -254,6 +254,7 @@ The following previously deprecated rules have been finally removed: * [#3782](https://github.com/pmd/pmd/issues/3782): \[core] Language lifecycle * [#3902](https://github.com/pmd/pmd/issues/3902): \[core] Violation decorators * [#4035](https://github.com/pmd/pmd/issues/4035): \[core] ConcurrentModificationException in DefaultRuleViolationFactory + * [#4120](https://github.com/pmd/pmd/issues/4120): \[core] Explicitly name all language versions * cli * [#3828](https://github.com/pmd/pmd/issues/3828): \[core] Progress reporting * [#4079](https://github.com/pmd/pmd/issues/4079): \[cli] Split off CLI implementation into a pmd-cli submodule From a283615299beb0abb9ac9204eff55b34b687393a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 10 Feb 2023 12:39:21 +0100 Subject: [PATCH 36/70] Refactor LanguageMetdata::extensions usages --- .../pmd/lang/LanguageModuleBase.java | 22 ++++++++++++++++++- .../pmd/lang/html/HtmlLanguageModule.java | 2 +- .../ecmascript/EcmascriptLanguageModule.java | 2 +- .../pmd/lang/jsp/JspLanguageModule.java | 2 +- .../pmd/lang/kotlin/KotlinLanguageModule.java | 3 ++- .../lang/modelica/ModelicaLanguageModule.java | 2 +- .../pmd/lang/plsql/PLSQLLanguageModule.java | 2 +- .../pmd/lang/scala/ScalaLanguageModule.java | 3 ++- .../pmd/lang/swift/SwiftLanguageModule.java | 2 +- .../pmd/lang/vf/VfLanguageModule.java | 7 +++--- .../pmd/lang/xml/XmlLanguageModule.java | 2 +- 11 files changed, 36 insertions(+), 13 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java index 8d4c648666..5f1b67c55b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java @@ -8,6 +8,7 @@ import static net.sourceforge.pmd.util.CollectionUtil.setOf; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -269,7 +270,7 @@ public abstract class LanguageModuleBase implements Language { /** * Record the {@linkplain Language#getExtensions() extensions} - * assigned to the language. Parameters should not start with a period + * assigned to the language. Extensions should not start with a period * {@code .}. * * @param e1 First extensions @@ -283,6 +284,25 @@ public abstract class LanguageModuleBase implements Language { return this; } + /** + * Record the {@linkplain Language#getExtensions() extensions} + * assigned to the language. Extensions should not start with a period + * {@code .}. At least one extension must be provided. + * + * @param extensions the extensions + * + * @throws NullPointerException If any extension is null + * @throws IllegalArgumentException If no extensions are provided + */ + public LanguageMetadata extensions(Collection extensions) { + this.extensions = new ArrayList<>(new HashSet<>(extensions)); + AssertionUtil.requireContainsNoNullValue("extensions", this.extensions); + if (this.extensions.isEmpty()) { + throw new IllegalArgumentException("At least one extension is required."); + } + return this; + } + /** * Add a new version by its name. * 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 0743f248b9..900ab8c381 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 @@ -21,7 +21,7 @@ public final class HtmlLanguageModule extends SimpleLanguageModuleBase { public HtmlLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions(EXTENSIONS.get(0), EXTENSIONS.subList(0, EXTENSIONS.size()).toArray(new String[0])) + .extensions(EXTENSIONS) .addVersion("4") .addDefaultVersion("5"), new HtmlHandler()); diff --git a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java index e8c56f48c3..9d68ea6b0d 100644 --- a/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java +++ b/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptLanguageModule.java @@ -25,7 +25,7 @@ public class EcmascriptLanguageModule extends SimpleLanguageModuleBase { public static final List EXTENSIONS = listOf("js"); public EcmascriptLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0)) + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS) .addVersion("3") .addVersion("5") .addVersion("6", "ES6", "ES2015") diff --git a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java index 33fb67c449..09741a8d67 100644 --- a/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java +++ b/pmd-jsp/src/main/java/net/sourceforge/pmd/lang/jsp/JspLanguageModule.java @@ -23,7 +23,7 @@ public class JspLanguageModule extends SimpleLanguageModuleBase { public JspLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME).shortName("JSP") - .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) + .extensions(EXTENSIONS) .addVersion("2") .addDefaultVersion("3"), new JspHandler()); diff --git a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java index 1bdaa924c7..6faf72c06b 100644 --- a/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java +++ b/pmd-kotlin/src/main/java/net/sourceforge/pmd/lang/kotlin/KotlinLanguageModule.java @@ -32,7 +32,8 @@ public class KotlinLanguageModule extends SimpleLanguageModuleBase { * Create a new instance of Kotlin Language Module. */ public KotlinLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions(EXTENSIONS) .addVersion("1.6") .addDefaultVersion("1.7"), new KotlinHandler()); diff --git a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java index e0c6863a8b..d43ef71c24 100644 --- a/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java +++ b/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java @@ -19,7 +19,7 @@ public class ModelicaLanguageModule extends SimpleLanguageModuleBase { public ModelicaLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions(EXTENSIONS.get(0)) + .extensions(EXTENSIONS) .addVersion("3.4") .addDefaultVersion("3.5"), new ModelicaHandler()); diff --git a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java index 01f262ac4b..81d1d3b929 100644 --- a/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java +++ b/pmd-plsql/src/main/java/net/sourceforge/pmd/lang/plsql/PLSQLLanguageModule.java @@ -34,7 +34,7 @@ public class PLSQLLanguageModule extends SimpleLanguageModuleBase { super( LanguageMetadata.withId(TERSE_NAME) .name(NAME) - .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) + .extensions(EXTENSIONS) .addVersion("11g") .addVersion("12c_Release_1", "12.1") .addVersion("12c_Release_2", "12.2") diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java index 6bfa00c615..1507c4716d 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ScalaLanguageModule.java @@ -35,7 +35,8 @@ public class ScalaLanguageModule extends SimpleLanguageModuleBase { * Create a new instance of Scala Language Module. */ public ScalaLanguageModule() { - super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS.get(0)) + super(LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions(EXTENSIONS) .addVersion("2.10") .addVersion("2.11") .addVersion("2.12") diff --git a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java index ac2daf61a5..a2c3192477 100644 --- a/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java +++ b/pmd-swift/src/main/java/net/sourceforge/pmd/lang/swift/SwiftLanguageModule.java @@ -29,7 +29,7 @@ public class SwiftLanguageModule extends SimpleLanguageModuleBase { */ public SwiftLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions(EXTENSIONS.get(0)) + .extensions(EXTENSIONS) .addVersion("4.2") .addVersion("5.0") .addVersion("5.1") diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java index 74f8596ea5..6ea4ea183f 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java @@ -31,9 +31,10 @@ public class VfLanguageModule extends SimpleLanguageModuleBase { } private static LanguageMetadata createMetdata() { - LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions(EXTENSIONS.get(0), EXTENSIONS.toArray(new String[0])) - .dependsOnLanguage(ApexLanguageModule.TERSE_NAME); + LanguageMetadata languageMetadata = + LanguageMetadata.withId(TERSE_NAME).name(NAME) + .extensions(EXTENSIONS) + .dependsOnLanguage(ApexLanguageModule.TERSE_NAME); // use the same versions as in Apex int lastVersion = ApexLanguageModule.VERSIONS.size() - 1; ApexLanguageModule.VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); diff --git a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java index 838fac01d0..b0ab3d3b00 100644 --- a/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java +++ b/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlLanguageModule.java @@ -23,7 +23,7 @@ public class XmlLanguageModule extends SimpleLanguageModuleBase { public XmlLanguageModule() { super(LanguageMetadata.withId(TERSE_NAME).name(NAME) - .extensions(EXTENSIONS.get(0)) + .extensions(EXTENSIONS) .addVersion("1.0") .addDefaultVersion("1.1"), new XmlHandler()); From 56dbdd1c95d345556ac36affcd5624394d3434e8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 Feb 2023 09:41:52 +0100 Subject: [PATCH 37/70] [core] Don't allow languages without versions --- .../pmd/lang/LanguageModuleBase.java | 8 ++------ .../pmd/lang/LanguageModuleBaseTest.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java index 5f1b67c55b..0d1d45553f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/LanguageModuleBase.java @@ -22,7 +22,6 @@ import org.apache.commons.lang3.StringUtils; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.lang.LanguageModuleBase.LanguageMetadata.LangVersionMetadata; import net.sourceforge.pmd.util.AssertionUtil; import net.sourceforge.pmd.util.StringUtil; @@ -45,7 +44,7 @@ public abstract class LanguageModuleBase implements Language { * Construct a module instance using the given metadata. The metadata must * be properly constructed. * - * @throws IllegalStateException If the metadata is invalid (eg missing extensions or name) + * @throws IllegalStateException If the metadata is invalid (eg missing extensions or name or no versions) */ protected LanguageModuleBase(LanguageMetadata metadata) { this.meta = metadata; @@ -56,10 +55,7 @@ public abstract class LanguageModuleBase implements Language { LanguageVersion defaultVersion = null; if (metadata.versionMetadata.isEmpty()) { - // Many languages have just one version, which is implicitly - // created here. - // TODO #4120 remove this branch, before 7.0.0 - metadata.versionMetadata.add(new LangVersionMetadata("", Collections.emptyList(), true)); + throw new IllegalStateException("No versions for '" + getId() + "'"); } int i = 0; diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageModuleBaseTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageModuleBaseTest.java index 64fae5a9c8..91e56eff8d 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageModuleBaseTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/LanguageModuleBaseTest.java @@ -28,6 +28,16 @@ class LanguageModuleBaseTest { assertInvalidId("C"); assertInvalidId("ab-c"); assertThrows(NullPointerException.class, () -> LanguageMetadata.withId(null)); + + Exception e = assertThrows(IllegalArgumentException.class, () -> LanguageMetadata.withId("dummy").addVersion(""), + "Empty versions should not be allowed."); + assertEquals("Invalid version name: ''", e.getMessage()); + assertThrows(IllegalArgumentException.class, () -> LanguageMetadata.withId("dummy").addVersion(" "), + "Empty versions should not be allowed."); + assertThrows(IllegalArgumentException.class, () -> LanguageMetadata.withId("dummy").addVersion(null), + "Empty versions should not be allowed."); + assertThrows(IllegalArgumentException.class, () -> LanguageMetadata.withId("dummy").addVersion("1.0", ""), + "Empty versions should not be allowed."); } @Test @@ -36,6 +46,13 @@ class LanguageModuleBaseTest { assertThat(lang.getDefaultVersion(), equalTo(lang.getVersion("abc"))); } + @Test + void testMissingVersions() { + Exception e = assertThrows(IllegalStateException.class, () -> makeLanguage(LanguageMetadata.withId("dumdum").name("Name").extensions("o")), + "Languages without versions should not be allowed."); + assertEquals("No versions for 'dumdum'", e.getMessage()); + } + @Test void testNoExtensions() { Exception ex = assertThrows(IllegalStateException.class, () -> makeLanguage(LanguageMetadata.withId("dumdum").name("Name").addVersion("abc"))); From eebe9088a737a3d0a8772f1dd554c87b7b8c3edd Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 Feb 2023 09:42:45 +0100 Subject: [PATCH 38/70] [doc] Update language versions doc --- docs/pages/pmd/userdocs/cli_reference.md | 10 ++++-- docs/pages/pmd/userdocs/tools/ant.md | 44 +++--------------------- 2 files changed, 12 insertions(+), 42 deletions(-) diff --git a/docs/pages/pmd/userdocs/cli_reference.md b/docs/pages/pmd/userdocs/cli_reference.md index ba0353d144..285089ef6e 100644 --- a/docs/pages/pmd/userdocs/cli_reference.md +++ b/docs/pages/pmd/userdocs/cli_reference.md @@ -224,7 +224,14 @@ non-preview version. If you want to use an older version, so that e.g. rules tha that are not available yet won't be executed, you need to specify a specific version via the `--use-version` parameter. -These parameters are irrelevant for languages that don't support different versions. +The selected language version can also influence which rules are applied. Some rules might be relevant for +just a specific version of the language. Such rules are marked with either `minimumLanguageVersion` or +`maximumLanguageVersion` or both. Most rules apply for all language versions. + +These parameters are most of the time irrelevant, if the rules apply for all versions. + +The available versions depend on the language. You can get a list of the currently supported language versions +via the CLI option `--help`. Example: @@ -245,7 +252,6 @@ Example: * [plsql](pmd_rules_plsql.html) * [pom](pmd_rules_pom.html) (Maven POM) * [scala](pmd_rules_scala.html) - * Supported Versions: 2.10, 2.11, 2.12, 2.13 (default) * [swift](pmd_rules_swift.html) * [vf](pmd_rules_vf.html) (Salesforce VisualForce) * [vm](pmd_rules_vm.html) (Apache Velocity) diff --git a/docs/pages/pmd/userdocs/tools/ant.md b/docs/pages/pmd/userdocs/tools/ant.md index c0637db94e..ae3abbcbab 100644 --- a/docs/pages/pmd/userdocs/tools/ant.md +++ b/docs/pages/pmd/userdocs/tools/ant.md @@ -211,48 +211,12 @@ sense with Java 1.7 and later. If your project uses Java 1.5, then you should co accordingly and this rule won't be executed. The specific version of a language to be used is selected via the `sourceLanguage` -nested element. Possible values are: +nested element. Example: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +The available versions depend on the language. You can get a list of the currently supported language versions +via the CLI option `--help`. ### Postprocessing the report file with XSLT From be6a46ccff63d17a7eea4876fb82fdf49028da9d Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 Feb 2023 11:22:52 +0100 Subject: [PATCH 39/70] [vf] Refactor dependency to apex language module --- .../pmd/lang/apex/ApexLanguageModule.java | 19 +++++++------------ .../pmd/lang/vf/VfLanguageModule.java | 13 ++++++++++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java index 33c9f5b0d6..8bb3084136 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java @@ -20,22 +20,17 @@ public class ApexLanguageModule extends LanguageModuleBase { public static final String NAME = "Apex"; public static final String TERSE_NAME = "apex"; - @InternalApi - public static final List VERSIONS = listOf("52", "53", "54", "55", "56", "57"); @InternalApi public static final List EXTENSIONS = listOf("cls", "trigger"); public ApexLanguageModule() { - super(createMetadata()); - } - - private static LanguageMetadata createMetadata() { - LanguageMetadata languageMetadata = LanguageMetadata.withId(TERSE_NAME).name(NAME); - languageMetadata.extensions(EXTENSIONS.get(0), EXTENSIONS.subList(0, EXTENSIONS.size()).toArray(new String[0])); - int lastVersion = VERSIONS.size() - 1; - VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); - languageMetadata.addDefaultVersion(VERSIONS.get(lastVersion)); - return languageMetadata; + super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions(EXTENSIONS) + .addVersion("52") + .addVersion("53") + .addVersion("54") + .addVersion("55") + .addVersion("56") + .addDefaultVersion("57")); } @Override diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java index 6ea4ea183f..e43738df99 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/VfLanguageModule.java @@ -12,6 +12,7 @@ import net.sourceforge.pmd.annotation.InternalApi; import net.sourceforge.pmd.lang.Language; import net.sourceforge.pmd.lang.LanguagePropertyBundle; import net.sourceforge.pmd.lang.LanguageRegistry; +import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.apex.ApexLanguageModule; import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase; @@ -36,9 +37,15 @@ public class VfLanguageModule extends SimpleLanguageModuleBase { .extensions(EXTENSIONS) .dependsOnLanguage(ApexLanguageModule.TERSE_NAME); // use the same versions as in Apex - int lastVersion = ApexLanguageModule.VERSIONS.size() - 1; - ApexLanguageModule.VERSIONS.subList(0, lastVersion).forEach(languageMetadata::addVersion); - languageMetadata.addDefaultVersion(ApexLanguageModule.VERSIONS.get(lastVersion)); + // need to create a temporary apex module, since the global language registry is not initialized yet + ApexLanguageModule temporaryApexModule = new ApexLanguageModule(); + LanguageVersion defaultApexVersion = temporaryApexModule.getDefaultVersion(); + for (LanguageVersion languageVersion : temporaryApexModule.getVersions()) { + if (!defaultApexVersion.equals(languageVersion)) { + languageMetadata.addVersion(languageVersion.getVersion()); + } + } + languageMetadata.addDefaultVersion(defaultApexVersion.getVersion()); return languageMetadata; } From 17364a997b1ff135cb48dc412a797286bb0025fe Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 Feb 2023 11:39:03 +0100 Subject: [PATCH 40/70] [doc] CPD - use non deprecated `--dir` cli option --- docs/pages/pmd/userdocs/cpd/cpd.md | 27 ++++++++++--------- docs/pages/pmd/userdocs/installation.md | 6 ++--- .../pmd/cpd/CPDCommandLineInterface.java | 4 +-- .../pmd/cpd/CPDCommandLineInterfaceTest.java | 6 ++--- .../pmd/it/BinaryDistributionIT.java | 6 ++--- .../pmd/cpd/CPDCommandLineInterfaceTest.java | 16 +++++------ .../pmd/cpd/CPDCommandLineInterfaceTest.java | 4 +-- 7 files changed, 35 insertions(+), 34 deletions(-) diff --git a/docs/pages/pmd/userdocs/cpd/cpd.md b/docs/pages/pmd/userdocs/cpd/cpd.md index 09b8ba2bdf..bbc21226ab 100644 --- a/docs/pages/pmd/userdocs/cpd/cpd.md +++ b/docs/pages/pmd/userdocs/cpd/cpd.md @@ -63,11 +63,12 @@ Novice as much as advanced readers may want to [read on on Refactoring Guru](htt required="yes" %} {% include custom/cli_option_row.html options="--files,--dir,-d" - description="List of files and directories to process" + description="List of files and directories to process. +

Note: `--files` is deprecated since PMD 6.52.0. Usage of `--dir` is preferred.

" required="yes" %} {% include custom/cli_option_row.html options="--file-list" - description="Path to file containing a comma delimited list of files to analyze. If this is given, then you don't need to provide `--files`." + description="Path to file containing a comma delimited list of files to analyze. If this is given, then you don't need to provide `--dir`." %} {% include custom/cli_option_row.html options="--language" description="Sources code language." @@ -157,49 +158,49 @@ _Note:_ The following example use the Linux start script. For Windows, just repl Minimum required options: Just give it the minimum duplicate size and the source directory: - $ ./run.sh cpd --minimum-tokens 100 --files /usr/local/java/src/java + $ ./run.sh cpd --minimum-tokens 100 --dir /usr/local/java/src/java You can also specify the language: - $ ./run.sh cpd --minimum-tokens 100 --files /path/to/c/source --language cpp + $ ./run.sh cpd --minimum-tokens 100 --dir /path/to/c/source --language cpp You may wish to check sources that are stored in different directories: - $ ./run.sh cpd --minimum-tokens 100 --files /path/to/other/source --files /path/to/other/source --files /path/to/other/source --language fortran + $ ./run.sh cpd --minimum-tokens 100 --dir /path/to/other/source --dir /path/to/other/source --dir /path/to/other/source --language fortran -There should be no limit to the number of '--files', you may add... But if you stumble one, please tell us ! +There should be no limit to the number of `--dir`, you may add... But if you stumble one, please tell us ! And if you're checking a C source tree with duplicate files in different architecture directories you can skip those using --skip-duplicate-files: - $ ./run.sh cpd --minimum-tokens 100 --files /path/to/c/source --language cpp --skip-duplicate-files + $ ./run.sh cpd --minimum-tokens 100 --dir /path/to/c/source --language cpp --skip-duplicate-files You can also specify the encoding to use when parsing files: - $ ./run.sh cpd --minimum-tokens 100 --files /usr/local/java/src/java --encoding utf-16le + $ ./run.sh cpd --minimum-tokens 100 --dir /usr/local/java/src/java --encoding utf-16le You can also specify a report format - here we're using the XML report: - $ ./run.sh cpd --minimum-tokens 100 --files /usr/local/java/src/java --format xml + $ ./run.sh cpd --minimum-tokens 100 --dir /usr/local/java/src/java --format xml The default format is a text report, and there's also a `csv` report. Note that CPD is pretty memory-hungry; you may need to give Java more memory to run it, like this: $ export PMD_JAVA_OPTS=-Xmx512m - $ ./run.sh cpd --minimum-tokens 100 --files /usr/local/java/src/java + $ ./run.sh cpd --minimum-tokens 100 --dir /usr/local/java/src/java In order to change the heap size under Windows, you'll need to edit the batch file `cpd.bat` or set the environment variable `PMD_JAVA_OPTS` prior to starting CPD: C:\ > cd C:\pmd-bin-{{site.pmd.version}}\bin C:\...\bin > set PMD_JAVA_OPTS=-Xmx512m - C:\...\bin > .\cpd.bat --minimum-tokens 100 --files c:\temp\src + C:\...\bin > .\cpd.bat --minimum-tokens 100 --dir c:\temp\src If you specify a source directory but don't want to scan the sub-directories, you can use the non-recursive option: - $ ./run.sh cpd --minimum-tokens 100 --non-recursive --files /usr/local/java/src/java + $ ./run.sh cpd --minimum-tokens 100 --non-recursive --dir /usr/local/java/src/java ### Exit status @@ -209,7 +210,7 @@ This behavior has been introduced to ease CPD integration into scripts or hooks, - +
0Everything is fine, no code duplications found
1Couldn't understand command line parameters or CPD exited with an exception
4At least one code duplication has been detected unless '--fail-on-violation false' is used.
4At least one code duplication has been detected unless `--fail-on-violation false` is used.
diff --git a/docs/pages/pmd/userdocs/installation.md b/docs/pages/pmd/userdocs/installation.md index 2a31ba3f8b..38f015faa4 100644 --- a/docs/pages/pmd/userdocs/installation.md +++ b/docs/pages/pmd/userdocs/installation.md @@ -116,7 +116,7 @@ Additionally, the following options, are specified most of the time even though Like for PMD, CPD is started on Unix by `run.sh cpd` and on Windows by `cpd.bat`. There are two required parameters: -* `--files `: path to the sources to analyse. This can be a file name, a +* `--dir `: path to the sources to analyse. This can be a file name, a directory or a jar or zip file containing the sources. * `--minimum-tokens `: the minimum token length which should be reported as a duplicate. @@ -138,7 +138,7 @@ There are two required parameters:
~ $ cd ~/bin/pmd-bin-{{site.pmd.version}}/bin
-~/.../bin $ ./run.sh cpd --minimum-tokens 100 --files /home/me/src
+~/.../bin $ ./run.sh cpd --minimum-tokens 100 --dir /home/me/src
 
   Found a 7 line (110 tokens) duplication in the following files:
   Starting at line 579 of /home/me/src/test/java/foo/FooTypeTest.java
@@ -154,7 +154,7 @@ There are two required parameters:
     
C:\ > cd C:\pmd-bin-{{site.pmd.version}}\bin
-C:\...\bin > .\cpd.bat --minimum-tokens 100 --files c:\temp\src
+C:\...\bin > .\cpd.bat --minimum-tokens 100 --dir c:\temp\src
 
   Found a 7 line (110 tokens) duplication in the following files:
   Starting at line 579 of c:\temp\src\test\java\foo\FooTypeTest.java
diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDCommandLineInterface.java b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDCommandLineInterface.java
index 990defedad..ab7c4143c6 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDCommandLineInterface.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDCommandLineInterface.java
@@ -214,12 +214,12 @@ public final class CPDCommandLineInterface {
         String helpText = " For example on Windows:" + PMD.EOL;
 
         helpText += " C:\\>" + "pmd-bin-" + PMDVersion.VERSION + "\\bin\\cpd.bat"
-                + " --minimum-tokens 100 --files c:\\jdk18\\src\\java" + PMD.EOL;
+                + " --minimum-tokens 100 --dir c:\\jdk18\\src\\java" + PMD.EOL;
         helpText += PMD.EOL;
 
         helpText += " For example on *nix:" + PMD.EOL;
         helpText += " $ " + "pmd-bin-" + PMDVersion.VERSION + "/bin/run.sh cpd"
-                + " --minimum-tokens 100 --files /path/to/java/code" + PMD.EOL;
+                + " --minimum-tokens 100 --dir /path/to/java/code" + PMD.EOL;
         helpText += PMD.EOL;
 
         helpText += " Supported languages: " + Arrays.toString(LanguageFactory.supportedLanguages) + PMD.EOL;
diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
index a01b355b7d..8ec8c41d61 100644
--- a/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
+++ b/pmd-core/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
@@ -70,7 +70,7 @@ public class CPDCommandLineInterfaceTest {
 
     @Test
     public void testEmptyResultRendering() {
-        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files",
+        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--dir",
                 SRC_DIR, "--format", "xml");
         final String expectedFilesXml = getExpectedFileEntriesXml(NUMBER_OF_TOKENS.keySet());
         assertEquals(CPD.StatusCode.OK, statusCode);
@@ -99,7 +99,7 @@ public class CPDCommandLineInterfaceTest {
 
     @Test
     public void testDebugLogging() {
-        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files",
+        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--dir",
                 SRC_DIR, "--debug");
         assertEquals(CPD.StatusCode.OK, statusCode);
         assertThat(errLog.getLog(), containsString("Tokenizing ")); // this is a debug logging
@@ -108,7 +108,7 @@ public class CPDCommandLineInterfaceTest {
     @Test
     public void testNormalLogging() {
         loggingRule.clear();
-        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--files",
+        CPD.StatusCode statusCode = CPD.runCpd("--minimum-tokens", "340", "--language", "java", "--dir",
                 SRC_DIR);
         assertEquals(CPD.StatusCode.OK, statusCode);
         assertThat(errLog.getLog(), not(containsString("Tokenizing "))); // this is a debug logging
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
index 36cf4f1b2e..ef0368c1b6 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
@@ -141,17 +141,17 @@ public class BinaryDistributionIT extends AbstractBinaryDistributionTest {
         result = CpdExecutor.runCpd(tempDir, "-h");
         result.assertExecutionResult(0, SUPPORTED_LANGUAGES_CPD);
 
-        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "10", "--format", "text", "--files", srcDir);
+        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "10", "--format", "text", "--dir", srcDir);
         result.assertExecutionResult(4, "Found a 10 line (55 tokens) duplication in the following files:");
         result.assertExecutionResult(4, "Class1.java");
         result.assertExecutionResult(4, "Class2.java");
 
-        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "10", "--format", "xml", "--files", srcDir);
+        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "10", "--format", "xml", "--dir", srcDir);
         result.assertExecutionResult(4, "");
         result.assertExecutionResult(4, "Class1.java\"/>");
         result.assertExecutionResult(4, "Class2.java\"/>");
 
-        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "1000", "--format", "text", "--files", srcDir);
+        result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "1000", "--format", "text", "--dir", srcDir);
         result.assertExecutionResult(0);
     }
 }
diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
index a43be3d6d9..87fea5e67d 100644
--- a/pmd-java/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
+++ b/pmd-java/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
@@ -22,7 +22,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
      */
     @Test
     public void testIgnoreIdentifiers() {
-        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "34", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "34", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--ignore-identifiers");
         Assert.assertTrue(out.contains("Found a 7 line (36 tokens) duplication"));
     }
@@ -32,7 +32,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
      */
     @Test
     public void testIgnoreIdentifiersFailOnViolationFalse() throws Exception {
-        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--ignore-identifiers", "--failOnViolation",
                 "false");
         Assert.assertTrue(out.contains("Found a 7 line (36 tokens) duplication"));
@@ -43,7 +43,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
      */
     @Test
     public void testIgnoreIdentifiersFailOnViolationFalseLongOption() throws Exception {
-        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--ignore-identifiers", "--fail-on-violation",
                 "false");
         Assert.assertTrue(out.contains("Found a 7 line (36 tokens) duplication"));
@@ -54,7 +54,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
      */
     @Test
     public void testExcludes() throws Exception {
-        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--ignore-identifiers", "--files",
+        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "34", "--language", "java", "--ignore-identifiers", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--exclude",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/File2.java");
         Assert.assertFalse(out.contains("Found a 7 line (34 tokens) duplication"));
@@ -70,7 +70,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
         // set the default encoding under Windows
         System.setProperty("file.encoding", "Cp1252");
 
-        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "34", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "34", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--ignore-identifiers", "--format", "xml",
                 // request UTF-8 for CPD
                 "--encoding", "UTF-8");
@@ -89,7 +89,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
      */
     @Test
     public void testBrokenAndValidFile() throws IOException {
-        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "10", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "10", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/badandgood/", "--format", "text", "--skip-lexical-errors");
         Assert.assertTrue(
                 Pattern.compile("Skipping .*?BadFile\\.java\\. Reason: Lexical error in file").matcher(out).find());
@@ -98,14 +98,14 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
 
     @Test
     public void testFormatXmlWithoutEncoding() throws Exception {
-        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "10", "--language", "java", "--files",
+        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "10", "--language", "java", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/clitest/", "--format", "xml");
         Assert.assertTrue(out.contains(""));
     }
 
     @Test
     public void testCSVFormat() throws Exception {
-        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "100", "--files", "src/test/resources/net/sourceforge/pmd/cpd/badandgood/",
+        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "100", "--dir", "src/test/resources/net/sourceforge/pmd/cpd/badandgood/",
                 "--language", "c", "--format", "csv");
         Assert.assertFalse(out.contains("Couldn't instantiate renderer"));
     }
diff --git a/pmd-javascript/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java b/pmd-javascript/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
index c6b4df8f27..cb05b5deaa 100644
--- a/pmd-javascript/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
+++ b/pmd-javascript/src/test/java/net/sourceforge/pmd/cpd/CPDCommandLineInterfaceTest.java
@@ -15,7 +15,7 @@ import net.sourceforge.pmd.cli.BaseCPDCLITest;
 public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
     @Test
     public void shouldFindDuplicatesWithDifferentFileExtensions() {
-        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "5", "--language", "js", "--files",
+        String out = runTest(CPD.StatusCode.DUPLICATE_CODE_FOUND, "--minimum-tokens", "5", "--language", "js", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/ts/File1.ts",
                 "src/test/resources/net/sourceforge/pmd/cpd/ts/File2.ts");
 
@@ -24,7 +24,7 @@ public class CPDCommandLineInterfaceTest extends BaseCPDCLITest {
 
     @Test
     public void shouldFindNoDuplicatesWithDifferentFileExtensions() {
-        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "5", "--language", "js", "--files",
+        String out = runTest(CPD.StatusCode.OK, "--minimum-tokens", "5", "--language", "js", "--dir",
                 "src/test/resources/net/sourceforge/pmd/cpd/ts/");
 
         assertThat(out.trim(), emptyString());

From abc0b3c94ef2eff25df4a3f177bf22233569eee9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= 
Date: Sat, 18 Feb 2023 15:55:08 +0100
Subject: [PATCH 41/70] Delete pmd-test/DummyLanguageModule

Refs #2436
---
 pmd-test/pom.xml                              | 11 +++
 .../pmd/test/lang/DummyLanguageModule.java    | 80 -------------------
 .../pmd/test/lang/ast/DummyNode.java          | 52 ------------
 .../pmd/testframework/RuleTst.java            | 10 +--
 .../testframework/SimpleAggregatorTst.java    |  2 +-
 .../net.sourceforge.pmd.lang.Language         |  1 -
 .../pmd/testframework/RuleTstTest.java        | 25 +++---
 7 files changed, 27 insertions(+), 154 deletions(-)
 delete mode 100644 pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java
 delete mode 100644 pmd-test/src/main/java/net/sourceforge/pmd/test/lang/ast/DummyNode.java
 delete mode 100644 pmd-test/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language

diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml
index 67644b89f6..38d864e93f 100644
--- a/pmd-test/pom.xml
+++ b/pmd-test/pom.xml
@@ -72,5 +72,16 @@
             mockito-core
             test
         
+
+        
+            
+            net.sourceforge.pmd
+            pmd-core
+            ${project.version}
+            test
+            tests
+            test-jar
+        
+
     
 
diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java
deleted file mode 100644
index 2a7026e9c5..0000000000
--- a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/DummyLanguageModule.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-package net.sourceforge.pmd.test.lang;
-
-import net.sourceforge.pmd.annotation.InternalApi;
-import net.sourceforge.pmd.lang.AbstractPmdLanguageVersionHandler;
-import net.sourceforge.pmd.lang.LanguageRegistry;
-import net.sourceforge.pmd.lang.ast.AstInfo;
-import net.sourceforge.pmd.lang.ast.Parser;
-import net.sourceforge.pmd.lang.ast.Parser.ParserTask;
-import net.sourceforge.pmd.lang.ast.RootNode;
-import net.sourceforge.pmd.lang.document.TextRegion;
-import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase;
-import net.sourceforge.pmd.test.lang.ast.DummyNode;
-
-/**
- * Dummy language used for testing PMD.
- *
- * @deprecated Don't use this directly. We can probably remove this in favour of plaintextlanguage
- *  when https://github.com/pmd/pmd/issues/3918 is merged
- */
-@Deprecated
-@InternalApi
-public class DummyLanguageModule extends SimpleLanguageModuleBase {
-
-    public static final String NAME = "Dummy";
-    public static final String TERSE_NAME = "dummy";
-
-    public DummyLanguageModule() {
-        super(LanguageMetadata.withId(TERSE_NAME).name(NAME).extensions("dummy")
-                              .addVersion("1.0")
-                              .addVersion("1.1")
-                              .addVersion("1.2")
-                              .addVersion("1.3")
-                              .addVersion("1.4")
-                              .addVersion("1.5", "5")
-                              .addVersion("1.6", "6")
-                              .addDefaultVersion("1.7", "7")
-                              .addVersion("1.8", "8"), new Handler());
-    }
-
-    public static DummyLanguageModule getInstance() {
-        return (DummyLanguageModule) LanguageRegistry.PMD.getLanguageByFullName(NAME);
-    }
-
-    public static class Handler extends AbstractPmdLanguageVersionHandler {
-
-        @Override
-        public Parser getParser() {
-            return DummyRootNode::new;
-        }
-    }
-
-    public static class DummyRootNode extends DummyNode implements RootNode {
-
-
-        private final AstInfo astInfo;
-
-        public DummyRootNode(ParserTask task) {
-            this.astInfo = new AstInfo<>(task, this);
-            withCoords(task.getTextDocument().getEntireRegion());
-            setImage("Foo");
-        }
-
-        @Override
-        public DummyRootNode withCoords(TextRegion region) {
-            super.withCoords(region);
-            return this;
-        }
-
-
-        @Override
-        public AstInfo getAstInfo() {
-            return astInfo;
-        }
-    }
-
-}
diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/ast/DummyNode.java b/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/ast/DummyNode.java
deleted file mode 100644
index a7e124e100..0000000000
--- a/pmd-test/src/main/java/net/sourceforge/pmd/test/lang/ast/DummyNode.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
- */
-
-package net.sourceforge.pmd.test.lang.ast;
-
-import java.util.Objects;
-
-import net.sourceforge.pmd.lang.ast.impl.AbstractNode;
-import net.sourceforge.pmd.lang.document.TextRegion;
-
-public class DummyNode extends AbstractNode {
-
-    private String image;
-    private TextRegion region = TextRegion.caretAt(0);
-
-    public DummyNode withCoords(TextRegion region) {
-        this.region = Objects.requireNonNull(region);
-        return this;
-    }
-
-    public DummyNode newChild() {
-        DummyNode child = new DummyNode();
-        addChild(child, getNumChildren());
-        return child;
-    }
-
-    @Override
-    public TextRegion getTextRegion() {
-        return region;
-    }
-
-    @Deprecated
-    @Override
-    public String toString() {
-        return "dummyNode";
-    }
-
-    @Override
-    public String getXPathNodeName() {
-        return "dummyNode";
-    }
-
-    @Override
-    public String getImage() {
-        return image;
-    }
-
-    public void setImage(String image) {
-        this.image = image;
-    }
-}
diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java
index 57e4791f68..5c3041c7dc 100644
--- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java
+++ b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/RuleTst.java
@@ -55,11 +55,9 @@ public abstract class RuleTst {
     }
 
     /**
-     * Find a rule in a certain ruleset by name
-     *
-     * todo make this static
+     * Find a rule in a certain ruleset by name.
      */
-    public Rule findRule(String ruleSet, String ruleName) {
+    public static Rule findRule(String ruleSet, String ruleName) {
         try {
             RuleSet parsedRset = new RuleSetLoader().warnDeprecated(false).loadFromResource(ruleSet);
             Rule rule = parsedRset.getRuleByName(ruleName);
@@ -139,8 +137,8 @@ public abstract class RuleTst {
      *
      * @return The rule once it has been reinitialised
      */
-    protected Rule reinitializeRule(Rule rule) {
-        return findRule(rule.getRuleSetName(), rule.getName());
+    private Rule reinitializeRule(Rule rule) {
+        return rule.deepCopy();
     }
 
 
diff --git a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java
index 0172b975a2..fc547bf983 100644
--- a/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java
+++ b/pmd-test/src/main/java/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java
@@ -19,7 +19,7 @@ import net.sourceforge.pmd.Rule;
  */
 public abstract class SimpleAggregatorTst extends RuleTst {
 
-    private List rules = new ArrayList<>();
+    private final List rules = new ArrayList<>();
 
     /**
      * Configure the rule tests to be executed. Override this method in
diff --git a/pmd-test/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language b/pmd-test/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language
deleted file mode 100644
index 825247a1cc..0000000000
--- a/pmd-test/src/main/resources/META-INF/services/net.sourceforge.pmd.lang.Language
+++ /dev/null
@@ -1 +0,0 @@
-net.sourceforge.pmd.test.lang.DummyLanguageModule
diff --git a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java b/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java
index ec4f67197b..63018beaa1 100644
--- a/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java
+++ b/pmd-test/src/test/java/net/sourceforge/pmd/testframework/RuleTstTest.java
@@ -4,9 +4,11 @@
 
 package net.sourceforge.pmd.testframework;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -18,26 +20,20 @@ import org.mockito.Mockito;
 
 import net.sourceforge.pmd.Rule;
 import net.sourceforge.pmd.RuleContext;
+import net.sourceforge.pmd.lang.DummyLanguageModule;
 import net.sourceforge.pmd.lang.LanguageProcessor;
 import net.sourceforge.pmd.lang.LanguageVersion;
+import net.sourceforge.pmd.lang.ast.DummyNode.DummyRootNode;
 import net.sourceforge.pmd.lang.ast.Node;
-import net.sourceforge.pmd.lang.document.TextRegion;
 import net.sourceforge.pmd.lang.rule.RuleTargetSelector;
-import net.sourceforge.pmd.test.lang.DummyLanguageModule;
-import net.sourceforge.pmd.test.lang.DummyLanguageModule.DummyRootNode;
 import net.sourceforge.pmd.test.schema.RuleTestDescriptor;
 
 class RuleTstTest {
-    private LanguageVersion dummyLanguage = DummyLanguageModule.getInstance().getDefaultVersion();
+    private final LanguageVersion dummyLanguage = DummyLanguageModule.getInstance().getDefaultVersion();
 
-    private Rule rule = mock(Rule.class);
+    private final Rule rule = mock(Rule.class);
 
-    private RuleTst ruleTester = new RuleTst() {
-        @Override
-        public Rule findRule(String ruleSet, String ruleName) {
-            return rule;
-        }
-    };
+    private final RuleTst ruleTester = spy(RuleTst.class);
 
     @Test
     void shouldCallStartAndEnd() {
@@ -68,16 +64,17 @@ class RuleTstTest {
         when(rule.getTargetSelector()).thenReturn(RuleTargetSelector.forRootOnly());
         when(rule.deepCopy()).thenReturn(rule);
 
-        final String code = "the\ncode";
+        final String code = "(a)(b)\n(c)";
         Mockito.doAnswer(invocation -> {
             RuleContext context = invocation.getArgument(1, RuleContext.class);
             DummyRootNode node = invocation.getArgument(0, DummyRootNode.class);
 
+            assertEquals(3, node.getNumChildren());
             // the violations are reported out of order
             // line 2
-            context.addViolation(node.newChild().withCoords(TextRegion.fromOffsetLength("the\n".length(), "code".length())));
+            context.addViolation(node.getChild(2));
             // line 1
-            context.addViolation(node.newChild().withCoords(TextRegion.fromOffsetLength(0, "the".length())));
+            context.addViolation(node.getChild(1));
             return null;
         }).when(rule).apply(any(Node.class), Mockito.any(RuleContext.class));
 

From 34c4f17572b3170d1fedbcb1e23d954a8b4b1cd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 15:16:32 -0300
Subject: [PATCH 42/70] Copy over results automatically

 - Don't expect cached results to be reported over the listener back
   into the cache
---
 .../pmd/cache/AbstractAnalysisCache.java      | 28 +++++++++++--------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java
index 5691870312..ca36b74aed 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java
@@ -66,18 +66,14 @@ public abstract class AbstractAnalysisCache implements AnalysisCache {
     @Override
     public boolean isUpToDate(final TextDocument document) {
         try (TimedOperation ignored = TimeTracker.startOperation(TimedOperationCategory.ANALYSIS_CACHE, "up-to-date check")) {
-            // There is a new file being analyzed, prepare entry in updated cache
-            final AnalysisResult updatedResult = new AnalysisResult(document.getCheckSum(), new ArrayList<>());
-            updatedResultsCache.put(document.getPathId(), updatedResult);
-
-            // Now check the old cache
-            final AnalysisResult analysisResult = fileResultsCache.get(document.getPathId());
+            final AnalysisResult cachedResult = fileResultsCache.get(document.getPathId());
+            final AnalysisResult updatedResult;
 
             // is this a known file? has it changed?
-            final boolean result = analysisResult != null
-                && analysisResult.getFileChecksum() == updatedResult.getFileChecksum();
+            final boolean upToDate = cachedResult != null
+                && cachedResult.getFileChecksum() == document.getCheckSum();
 
-            if (result) {
+            if (upToDate) {
                 LOG.debug("Incremental Analysis cache HIT");
                 
                 /*
@@ -85,13 +81,21 @@ public abstract class AbstractAnalysisCache implements AnalysisCache {
                  * so we can honor relativized paths for the current run
                  */
                 final String displayName = document.getDisplayName();
-                analysisResult.getViolations().forEach(v -> ((CachedRuleViolation) v).setFileDisplayName(displayName));
+                cachedResult.getViolations().forEach(v -> ((CachedRuleViolation) v).setFileDisplayName(displayName));
+                
+                // copy results over
+                updatedResult = cachedResult;
             } else {
                 LOG.debug("Incremental Analysis cache MISS - {}",
-                          analysisResult != null ? "file changed" : "no previous result found");
+                          cachedResult != null ? "file changed" : "no previous result found");
+                
+                // New file being analyzed, create new empty entry
+                updatedResult = new AnalysisResult(document.getCheckSum(), new ArrayList<>());
             }
 
-            return result;
+            updatedResultsCache.put(document.getPathId(), updatedResult);
+            
+            return upToDate;
         }
     }
 

From a55cdbbcb7418ff1fa8c20ff4f34ba42b3d8eaad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 16:41:49 -0300
Subject: [PATCH 43/70] Add Incremental Analysis integration tests

---
 .../sourceforge/pmd/it/AnalysisCacheIT.java   | 60 +++++++++++++++++++
 .../pmd/it/BinaryDistributionIT.java          | 10 ++--
 .../sourceforge/pmd/it/ExecutionResult.java   |  7 +++
 .../net/sourceforge/pmd/it/PMDExecutor.java   | 20 ++++---
 4 files changed, 82 insertions(+), 15 deletions(-)
 create mode 100644 pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
new file mode 100644
index 0000000000..9c01b1b328
--- /dev/null
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
@@ -0,0 +1,60 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+package net.sourceforge.pmd.it;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import org.junit.jupiter.api.Test;
+
+class AnalysisCacheIT extends AbstractBinaryDistributionTest {
+
+    private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath();
+
+    @Test
+    void testPmdCachedResultMatches() throws Exception {
+        final Path cacheFile = createTemporaryReportFile();
+        
+        ExecutionResult result = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
+                "-f", "text", "--cache", cacheFile.toAbsolutePath().toString(), "--no-progress");
+        
+        // Ensure we have violations and a non-empty cache file
+        assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
+        result.assertExecutionResult(4, "", srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        
+        // rerun from cache
+        ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
+                "-f", "text", "--cache", cacheFile.toAbsolutePath().toString(), "--no-progress", "-v");
+
+        // expect identical
+        result.assertIdenticalResults(resultFromCache);
+        resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
+    }
+    
+    @Test
+    void testPmdCachedResultsAreRelativized() throws Exception {
+        final Path cacheFile = createTemporaryReportFile();
+        
+        ExecutionResult result = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
+                "-f", "text", "--cache", cacheFile.toAbsolutePath().toString(), "--no-progress");
+        
+        // Ensure we have violations and a non-empty cache file
+        assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
+        result.assertExecutionResult(4, "", srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        
+        // rerun from cache with relativized paths
+        ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", Paths.get(".").toAbsolutePath().relativize(Paths.get(srcDir)).toString(), "-R", "src/test/resources/rulesets/sample-ruleset.xml",
+                "-f", "text", "--cache", cacheFile.toAbsolutePath().toString(), "--no-progress", "-v");
+        
+        resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
+
+        // An error with the relative path should exist, but no with the absolute one
+        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        resultFromCache.assertNoErrorInReport(srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+    }
+}
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
index dab324f1df..0d950f6351 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
@@ -116,13 +116,13 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest {
 
     @Test
     void testPmdHelp() throws Exception {
-        ExecutionResult result = PMDExecutor.runPMD(tempDir, "-h");
+        ExecutionResult result = PMDExecutor.runPMD(null, tempDir, "-h");
         result.assertExecutionResult(0, SUPPORTED_LANGUAGES_PMD);
     }
 
     @Test
     void testPmdNoArgs() throws Exception {
-        ExecutionResult result = PMDExecutor.runPMD(tempDir); // without any argument, display usage help and error
+        ExecutionResult result = PMDExecutor.runPMD(null, tempDir); // without any argument, display usage help and error
         result.assertExecutionResultErrOutput(2, "Usage: pmd check ");
     }
 
@@ -132,15 +132,13 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest {
 
         ExecutionResult result;
 
-        result = PMDExecutor.runPMD(tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
-                "-r", createTemporaryReportFile().toString());
+        result = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml");
         result.assertExecutionResult(4);
         result.assertErrorOutputContains("[main] INFO net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand - Log level is at INFO");
 
 
         // now with debug
-        result = PMDExecutor.runPMD(tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
-                "-r", createTemporaryReportFile().toString(), "--debug");
+        result = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml", "--debug");
         result.assertExecutionResult(4);
         result.assertErrorOutputContains("[main] INFO net.sourceforge.pmd.cli.commands.internal.AbstractPmdSubcommand - Log level is at TRACE");
     }
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
index ee00990309..b63a164d2c 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
@@ -136,6 +136,13 @@ public class ExecutionResult {
     public void assertErrorOutputContains(String message) {
         assertTrue(errorOutput.contains(message), "erroroutput didn't contain " + message);
     }
+    
+    public void assertIdenticalResults(ExecutionResult other) {
+    	// Notice we don't check for error output, as log messages may differ due to cache
+    	assertEquals(exitCode, other.exitCode, "Exit codes differ");
+    	assertEquals(output, other.output, "Outputs differ");
+    	assertEquals(report, other.report, "Reports differ");
+    }
 
     static class Builder {
         private int exitCode;
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
index 7998ae0652..9298bc8eaa 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
@@ -54,6 +54,12 @@ public class PMDExecutor {
 
     static ExecutionResult runCommand(String cmd, List arguments, Path reportFile) throws Exception {
         ProcessBuilder pb = new ProcessBuilder(cmd);
+        
+        if (reportFile != null) {
+        	arguments.add(REPORTFILE_FLAG);
+        	arguments.add(reportFile.toString());
+        }
+        
         pb.command().addAll(arguments);
         pb.redirectErrorStream(false);
         
@@ -118,27 +124,23 @@ public class PMDExecutor {
     }
 
     public static ExecutionResult runPMDRules(Path reportFile, Path tempDir, String sourceDirectory, String ruleset, String formatter) throws Exception {
-        if (SystemUtils.IS_OS_WINDOWS) {
-            return runPMDWindows(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
+    	return runPMD(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
                     FORMAT_FLAG, formatter, REPORTFILE_FLAG, reportFile.toAbsolutePath().toString(), NO_PROGRESSBAR_FLAG);
-        } else {
-            return runPMDUnix(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
-                    FORMAT_FLAG, formatter, REPORTFILE_FLAG, reportFile.toAbsolutePath().toString(), NO_PROGRESSBAR_FLAG);
-        }
     }
 
     /**
      * Executes PMD found in tempDir with the given command line arguments.
+     * @param reportFile The location where to store the result. If null, the report will be discarded.
      * @param tempDir the directory, to which the binary distribution has been extracted
      * @param arguments the arguments to execute PMD with
      * @return collected result of the execution
      * @throws Exception if the execution fails for any reason (executable not found, ...)
      */
-    public static ExecutionResult runPMD(Path tempDir, String... arguments) throws Exception {
+    public static ExecutionResult runPMD(Path reportFile, Path tempDir, String... arguments) throws Exception {
         if (SystemUtils.IS_OS_WINDOWS) {
-            return runPMDWindows(tempDir, null, arguments);
+            return runPMDWindows(tempDir, reportFile, arguments);
         } else {
-            return runPMDUnix(tempDir, null, arguments);
+            return runPMDUnix(tempDir, reportFile, arguments);
         }
     }
 }

From f4d1c142839c27dff051c562eaee9f386807e353 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 16:42:16 -0300
Subject: [PATCH 44/70] Actually ensure the path ids are consistent

---
 .../java/net/sourceforge/pmd/lang/document/NioTextFile.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/NioTextFile.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/NioTextFile.java
index b6b74edaf3..1b8d30c590 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/NioTextFile.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/document/NioTextFile.java
@@ -47,7 +47,8 @@ class NioTextFile extends BaseCloseable implements TextFile {
         this.charset = charset;
         this.languageVersion = languageVersion;
         // using the URI here, that handles files inside zip archives automatically (schema "jar:file:...!/path/inside/zip")
-        this.pathId = path.toUri().toString();
+        // normalization ensures cannonical paths
+        this.pathId = path.normalize().toUri().toString();
     }
 
     @Override

From 7cab83ae97acdad316e647e82a4f7a60d9cc2066 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 19:19:41 -0300
Subject: [PATCH 45/70] Style fixes

---
 .../test/java/net/sourceforge/pmd/it/ExecutionResult.java | 8 ++++----
 .../src/test/java/net/sourceforge/pmd/it/PMDExecutor.java | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
index b63a164d2c..4304dff04c 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java
@@ -138,10 +138,10 @@ public class ExecutionResult {
     }
     
     public void assertIdenticalResults(ExecutionResult other) {
-    	// Notice we don't check for error output, as log messages may differ due to cache
-    	assertEquals(exitCode, other.exitCode, "Exit codes differ");
-    	assertEquals(output, other.output, "Outputs differ");
-    	assertEquals(report, other.report, "Reports differ");
+        // Notice we don't check for error output, as log messages may differ due to cache
+        assertEquals(exitCode, other.exitCode, "Exit codes differ");
+        assertEquals(output, other.output, "Outputs differ");
+        assertEquals(report, other.report, "Reports differ");
     }
 
     static class Builder {
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
index 9298bc8eaa..680cfb5898 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
@@ -56,8 +56,8 @@ public class PMDExecutor {
         ProcessBuilder pb = new ProcessBuilder(cmd);
         
         if (reportFile != null) {
-        	arguments.add(REPORTFILE_FLAG);
-        	arguments.add(reportFile.toString());
+            arguments.add(REPORTFILE_FLAG);
+            arguments.add(reportFile.toString());
         }
         
         pb.command().addAll(arguments);
@@ -124,7 +124,7 @@ public class PMDExecutor {
     }
 
     public static ExecutionResult runPMDRules(Path reportFile, Path tempDir, String sourceDirectory, String ruleset, String formatter) throws Exception {
-    	return runPMD(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
+        return runPMD(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
                     FORMAT_FLAG, formatter, REPORTFILE_FLAG, reportFile.toAbsolutePath().toString(), NO_PROGRESSBAR_FLAG);
     }
 

From 4f1a307962558ac38a6f7eb56fd101167794742d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 21:21:01 -0300
Subject: [PATCH 46/70] Fix broken call

---
 .../src/test/java/net/sourceforge/pmd/it/PMDExecutor.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
index 680cfb5898..9ce3b49546 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java
@@ -124,8 +124,8 @@ public class PMDExecutor {
     }
 
     public static ExecutionResult runPMDRules(Path reportFile, Path tempDir, String sourceDirectory, String ruleset, String formatter) throws Exception {
-        return runPMD(tempDir, reportFile, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
-                    FORMAT_FLAG, formatter, REPORTFILE_FLAG, reportFile.toAbsolutePath().toString(), NO_PROGRESSBAR_FLAG);
+        return runPMD(reportFile, tempDir, SOURCE_DIRECTORY_FLAG, sourceDirectory, RULESET_FLAG, ruleset,
+                    FORMAT_FLAG, formatter, NO_PROGRESSBAR_FLAG);
     }
 
     /**

From 2b58f285e8ee1cb5b036e59882a94c7605207ce6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 22:53:33 -0300
Subject: [PATCH 47/70] Be OS agnostic

---
 .../test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
index 9c01b1b328..fa08b2ad6a 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
@@ -25,7 +25,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         
         // Ensure we have violations and a non-empty cache file
         assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
-        result.assertExecutionResult(4, "", srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        result.assertExecutionResult(4, "", srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
         
         // rerun from cache
         ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
@@ -45,7 +45,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         
         // Ensure we have violations and a non-empty cache file
         assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
-        result.assertExecutionResult(4, "", srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        result.assertExecutionResult(4, "", srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
         
         // rerun from cache with relativized paths
         ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", Paths.get(".").toAbsolutePath().relativize(Paths.get(srcDir)).toString(), "-R", "src/test/resources/rulesets/sample-ruleset.xml",
@@ -54,7 +54,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
 
         // An error with the relative path should exist, but no with the absolute one
-        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
-        resultFromCache.assertNoErrorInReport(srcDir + "/JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/',  File.pathSeparatorChar));
+        resultFromCache.assertNoErrorInReport(srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
     }
 }

From 79d9c90d18c4690499f3f87a19c5138eb5380542 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 23:17:30 -0300
Subject: [PATCH 48/70] Fix style error

---
 .../src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
index fa08b2ad6a..9cab77cd0a 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
@@ -54,7 +54,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
 
         // An error with the relative path should exist, but no with the absolute one
-        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/',  File.pathSeparatorChar));
+        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.pathSeparatorChar));
         resultFromCache.assertNoErrorInReport(srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
     }
 }

From 9a3a5f5cfe330186e13b23638128bc7c4995c186 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sat, 18 Feb 2023 23:38:39 -0300
Subject: [PATCH 49/70] Use proper separator

---
 .../test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
index 9cab77cd0a..ef010cb850 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java
@@ -25,7 +25,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         
         // Ensure we have violations and a non-empty cache file
         assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
-        result.assertExecutionResult(4, "", srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
         
         // rerun from cache
         ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml",
@@ -45,7 +45,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         
         // Ensure we have violations and a non-empty cache file
         assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run");
-        result.assertExecutionResult(4, "", srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
         
         // rerun from cache with relativized paths
         ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", Paths.get(".").toAbsolutePath().relativize(Paths.get(srcDir)).toString(), "-R", "src/test/resources/rulesets/sample-ruleset.xml",
@@ -54,7 +54,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest {
         resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT");
 
         // An error with the relative path should exist, but no with the absolute one
-        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.pathSeparatorChar));
-        resultFromCache.assertNoErrorInReport(srcDir + File.pathSeparator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
+        resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.separatorChar));
+        resultFromCache.assertNoErrorInReport(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t");
     }
 }

From 5400dddc7df259b318d5ce56f014d2b3f14cd3ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?=
 
Date: Sun, 19 Feb 2023 14:33:14 -0300
Subject: [PATCH 50/70] Improve documentation and revise impl

 - No need to copy the subexpression
 - Improve the check for needing to copy
---
 .../internal/SaxonExprTransformations.java    | 24 ++++++++++++++-----
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java
index 62ff9e304b..cfc1b48f02 100644
--- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java
+++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java
@@ -94,6 +94,11 @@ final class SaxonExprTransformations {
      * Splits a venn expression with the union operator into single expressions.
      *
      * 

E.g. "//A | //B | //C" will result in 3 expressions "//A", "//B", and "//C". + * + * This split will skip into any top-level lets. So, for "let $a := e1 in (e2 | e3)" + * this will return the subexpression e2 and e3. To ensure the splits are actually equivalent + * you will have to call {@link #copyTopLevelLets(Expression, Expression)} on each subexpression + * to turn them back into "let $a := e1 in e2" and "let $a := e1 in e3" respectively. */ static Iterable splitUnions(Expression expr) { SplitUnions unions = new SplitUnions(); @@ -104,10 +109,18 @@ final class SaxonExprTransformations { return unions.getExpressions(); } - static Expression copyTopLevelLets(Expression modified, Expression original) { + /** + * Wraps a given subexpression in all top-level lets from the original. + * If the subexpression matches the original, then nothing is done. + * + * @param subexpr The subexpression that has been manipulated. + * @param original The original expression from which it was obtained by calling {@link #splitUnions(Expression)}. + * @return The subexpression, wrapped in a copy of all top-level let expression from the original. + */ + static Expression copyTopLevelLets(Expression subexpr, Expression original) { // Does it need them? - if (modified instanceof LetExpression) { - return modified; + if (subexpr.equals(original)) { + return subexpr; } final SaxonExprVisitor topLevelLetCopier = new SaxonExprVisitor() { @@ -120,10 +133,9 @@ final class SaxonExprTransformations { } // Manually craft the inner-most LetExpression - Expression action = visit(modified); Expression sequence = visit(e.getSequence()); LetExpression result = new LetExpression(); - result.setAction(action); + result.setAction(subexpr); result.setSequence(sequence); result.setVariableQName(e.getVariableQName()); result.setRequiredType(e.getRequiredType()); @@ -136,6 +148,6 @@ final class SaxonExprTransformations { return topLevelLetCopier.visit(original); } - return modified; + return subexpr; } } From 24311796d10367e94c7dd7aeba8107889338d809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 19 Feb 2023 17:21:10 -0300 Subject: [PATCH 51/70] Fix the equality check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Guess at some point someone does a copy even if it's the original… --- .../xpath/internal/SaxonExprTransformations.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java index cfc1b48f02..27906974f3 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonExprTransformations.java @@ -118,10 +118,19 @@ final class SaxonExprTransformations { * @return The subexpression, wrapped in a copy of all top-level let expression from the original. */ static Expression copyTopLevelLets(Expression subexpr, Expression original) { - // Does it need them? - if (subexpr.equals(original)) { + if (!(original instanceof LetExpression)) { return subexpr; } + + // Does it need them? Or is it already the same variable under the same assignment? + if (subexpr instanceof LetExpression) { + final LetExpression letSubexpr = (LetExpression) subexpr; + final LetExpression letOriginal = (LetExpression) original; + if (letOriginal.getVariableQName().equals(letSubexpr.getVariableQName()) + && letSubexpr.getSequence().toString().equals(letOriginal.getSequence().toString())) { + return subexpr; + } + } final SaxonExprVisitor topLevelLetCopier = new SaxonExprVisitor() { From 8736174f09dbcf3206aeca4d1d9dafe46fe86097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 20 Feb 2023 21:47:03 +0100 Subject: [PATCH 52/70] Remove forgotten things from pmd-core/pom.xml --- pmd-core/pom.xml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index f96c3256be..621b770cde 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -13,24 +13,6 @@ - - org.codehaus.mojo - build-helper-maven-plugin - - - add-javacc-generated-sources - - add-source - - - - ${project.build.directory}/generated-sources/javacc - - - - - - org.apache.maven.plugins maven-checkstyle-plugin @@ -54,11 +36,6 @@ - - net.java.dev.javacc - javacc - provided - org.slf4j From c041fa4bd35e9ceb436f67dfeb4af7e126a9e426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 21 Feb 2023 00:57:32 -0300 Subject: [PATCH 53/70] Fix xpath expression --- pmd-java/src/main/resources/category/java/errorprone.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index b6889d8454..f446c8dc5f 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2364,7 +2364,7 @@ $topLevelClass[ (: or has non-default constructors … :) ClassOrInterfaceBody/ConstructorDeclaration and (: … but only private … :) - not(ClassOrInterfaceBody/ConstructorDeclaration[pmd-java:modifiers() != "private"]) and + not(ClassOrInterfaceBody/ConstructorDeclaration[@Visibility != "private"]) and (: … and none annotated … :) (every $x in $annotations satisfies not(ClassOrInterfaceBody/ConstructorDeclaration/ModifierList/Annotation[pmd-java:typeIs($x)])) @@ -2379,10 +2379,10 @@ $topLevelClass[ not(ClassOrInterfaceBody/ClassOrInterfaceDeclaration [pmd-java:modifiers() = "static" and @Visibility != "private"] (: … with a default or non-private constructor … :) - [not(ClassOrInterfaceBody/ConstructorDeclaration) or ClassOrInterfaceBody/ConstructorDeclaration[pmd-java:modifiers() != "private"]] + [not(ClassOrInterfaceBody/ConstructorDeclaration) or ClassOrInterfaceBody/ConstructorDeclaration[@Visibility != "private"]] (: … and a non-private method returning the outer class type … :) [(ClassOrInterfaceBody/MethodDeclaration - [pmd-java:modifiers() != "private"] + [@Visibility != "private"] [descendant::ReturnStatement/*[1][pmd-java:typeIs(ancestor::ClassOrInterfaceDeclaration[@Nested = false()]/@BinaryName)]] ) or ( (: … or the inner class extends the outer class :) From 3a5d2cb3ee94272457af4f80c13bb6ab4ec704e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 21 Feb 2023 00:57:57 -0300 Subject: [PATCH 54/70] Add more tests --- .../MissingStaticMethodInNonInstantiatableClass.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml index f1db090193..7ac6b0ce43 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/MissingStaticMethodInNonInstantiatableClass.xml @@ -59,6 +59,17 @@ public class Foo { } ]]> + + + package constructor is ok + 0 + + ok, one static method From e5f91ea57b65e31a0fea94f50da2846761714a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 21 Feb 2023 22:01:47 +0100 Subject: [PATCH 55/70] Add back javacc dep to antrun plugin --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 51e7ad9946..bd95fe68e1 100644 --- a/pom.xml +++ b/pom.xml @@ -160,6 +160,13 @@ org.apache.maven.plugins maven-antrun-plugin 3.1.0 + + + net.java.dev.javacc + javacc + ${javacc.version} + + org.apache.maven.plugins From 48664cf32bf36c5105588e0a68be31e695d8742c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 21 Feb 2023 22:05:44 +0100 Subject: [PATCH 56/70] Also remove default dependency --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index bd95fe68e1..484300cbb1 100644 --- a/pom.xml +++ b/pom.xml @@ -697,12 +697,6 @@ Saxon-HE ${saxon.version} - - net.java.dev.javacc - javacc - ${javacc.version} - provided - org.apache.commons commons-lang3 From 794263c463e86df5b2e9462989554c5739ac23e4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 Feb 2023 11:23:38 +0100 Subject: [PATCH 57/70] [doc] Update release notes - last pmd6 release, pmd7 development --- docs/pages/release_notes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 96b7f96794..362c4de285 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,6 +14,18 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy +#### PMD 7 Development + +This release is the last planned release of PMD 6. The first version 6.0.0 was released in December 2017. +Over the course of more than 5 years we published almost every month a new minor version of PMD 6 +with new features and improvements. + +Already in November 2018 we started in parallel the development of the next major version 7.0.0, +and we are now in the process of finalizing the scope of the major version. We want to release a couple of +release candidates before publishing the final version 7.0.0. + +We plan to release 7.0.0-rc1 soon. You can see the progress in [PMD 7 Tracking Issue #3898](https://github.com/pmd/pmd/issues/3898). + #### T-SQL support Thanks to the contribution from [Paul Guyot](https://github.com/pguyot) PMD now has CPD support for T-SQL (Transact-SQL). From b491afc628ec9c1c67f5f4825b95ea2290d82ca3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 25 Feb 2023 11:38:40 +0100 Subject: [PATCH 58/70] Prepare pmd release 6.55.0 --- docs/_config.yml | 2 +- docs/pages/next_major_development.md | 12 ++++++++++++ docs/pages/release_notes.md | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index eeef2bc8d6..83ce3a0d05 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ repository: pmd/pmd pmd: - version: 6.55.0-SNAPSHOT + version: 6.55.0 previous_version: 6.54.0 date: 25-February-2023 release_type: minor diff --git a/docs/pages/next_major_development.md b/docs/pages/next_major_development.md index 22a0a9f84f..d30d5e4f5b 100644 --- a/docs/pages/next_major_development.md +++ b/docs/pages/next_major_development.md @@ -125,6 +125,18 @@ the breaking API changes will be performed in 7.0.0. an API is tagged as `@Deprecated` or not in the latest minor release. During the development of 7.0.0, we may decide to remove some APIs that were not tagged as deprecated, though we'll try to avoid it." %} +#### 6.55.0 + +##### Go +* The LanguageModule of Go, that only supports CPD execution, has been deprecated. This language + is not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is + not affected by this change. The following class has been deprecated and will be removed with PMD 7.0.0: + * {% jdoc go::lang.go.GoLanguageModule %} + +##### Java +* Support for Java 18 preview language features have been removed. The version "18-preview" is no longer available. +* The experimental class `net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern` has been removed. + #### 6.54.0 ##### PMD CLI diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 7cb0f12021..123f813c6e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -72,5 +72,10 @@ Being based on a proper Antlr grammar, CPD can: * [#4390](https://github.com/pmd/pmd/pull/4390): Add support for T-SQL using Antlr4 lexer - [Paul Guyot](https://github.com/pguyot) (@pguyot) * [#4392](https://github.com/pmd/pmd/pull/4392): \[java] Fix #4393 MissingStaticMethodInNonInstantiatableClass: Fix false-positive for field-only class - [Dawid Ciok](https://github.com/dawiddc) (@dawiddc) +### Stats +* 40 commits +* 11 closed tickets & PRs +* Days since last release: 28 + {% endtocmaker %} From ef3455348603aa25f86894b9930f05f141f44d20 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 25 Feb 2023 11:50:49 +0100 Subject: [PATCH 59/70] [maven-release-plugin] prepare release pmd_releases/6.55.0 --- pmd-apex-jorje/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-java8/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-scala/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-vm/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 40 files changed, 42 insertions(+), 42 deletions(-) diff --git a/pmd-apex-jorje/pom.xml b/pmd-apex-jorje/pom.xml index 61c2f3a3a9..84426557ab 100644 --- a/pmd-apex-jorje/pom.xml +++ b/pmd-apex-jorje/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index fa4a3c7e43..a9b5a55b6d 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 97b052393e..601b30e6d0 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 9aba2af8c3..61109815fa 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 5eb8c400e4..eafaf31eff 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 76636bd9b6..29115f7c74 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 17850a571b..c54e2240b2 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 10dd4cca36..60d1f88b7b 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 88ab37a18e..254dfff61f 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index 40ccafd326..f530235056 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 4d7fc9763e..f09ed2d027 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index 2c9ec3bdf4..ad8a8ab254 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index d21c126714..b12432e9cb 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 17a1bec21d..c7d75a6313 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-java8/pom.xml b/pmd-java8/pom.xml index 2058844748..15441bc113 100644 --- a/pmd-java8/pom.xml +++ b/pmd-java8/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index a19ac4e058..998bed876d 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index 0b022ed4bc..afe8674dc6 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 39f9e0ab01..7cc60ed98a 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 3cc84fd5a4..e0c19ba30c 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index f0f410e8bb..fde7a0b8c4 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index c328c0ceb2..99099d7f60 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 249911156d..7baa043ff8 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index a9bd1f1451..e35736b8a2 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 466a465ba2..7874310b95 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 2329a8d0f4..248dc65bd8 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index 66a4693dca..ab14374a71 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 18d1062e76..4a19cebaf2 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index af896d7af7..12edeee182 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index b456383e83..e2bd003a59 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index f693007074..810fd29784 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.55.0-SNAPSHOT + 6.55.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 2794f13d81..7b638624c2 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.55.0-SNAPSHOT + 6.55.0 ../pmd-scala-common/pom.xml diff --git a/pmd-scala/pom.xml b/pmd-scala/pom.xml index 25f52ba1a9..6be1e52b24 100644 --- a/pmd-scala/pom.xml +++ b/pmd-scala/pom.xml @@ -9,7 +9,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index d5c7bb0c26..c04becb5ea 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index e665f2f3a2..3bb010f741 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 774a0d866e..64ffa61da4 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 09294425b2..5046416655 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 6bf536c8ee..3e7c9cb8e0 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-vm/pom.xml b/pmd-vm/pom.xml index b424b224d4..d8867d1e4b 100644 --- a/pmd-vm/pom.xml +++ b/pmd-vm/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index eebf49c330..25feaee24a 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 ../pom.xml diff --git a/pom.xml b/pom.xml index 02f5546d6d..a6c6c28c9a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 6.55.0-SNAPSHOT + 6.55.0 pom PMD @@ -60,7 +60,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - HEAD + pmd_releases/6.55.0 @@ -81,7 +81,7 @@ - 2023-01-28T09:31:52Z + 2023-02-25T10:38:58Z 7 From 2fc85cfe246fd91a8608d7ba74d16db6002385e3 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 25 Feb 2023 11:50:54 +0100 Subject: [PATCH 60/70] [maven-release-plugin] prepare for next development iteration --- pmd-apex-jorje/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-core/pom.xml | 2 +- pmd-cpp/pom.xml | 2 +- pmd-cs/pom.xml | 2 +- pmd-dart/pom.xml | 2 +- pmd-dist/pom.xml | 2 +- pmd-doc/pom.xml | 2 +- pmd-fortran/pom.xml | 2 +- pmd-gherkin/pom.xml | 2 +- pmd-go/pom.xml | 2 +- pmd-groovy/pom.xml | 2 +- pmd-html/pom.xml | 2 +- pmd-java/pom.xml | 2 +- pmd-java8/pom.xml | 2 +- pmd-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-lua/pom.xml | 2 +- pmd-matlab/pom.xml | 2 +- pmd-modelica/pom.xml | 2 +- pmd-objectivec/pom.xml | 2 +- pmd-perl/pom.xml | 2 +- pmd-php/pom.xml | 2 +- pmd-plsql/pom.xml | 2 +- pmd-python/pom.xml | 2 +- pmd-ruby/pom.xml | 2 +- pmd-scala-modules/pmd-scala-common/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.12/pom.xml | 2 +- pmd-scala-modules/pmd-scala_2.13/pom.xml | 2 +- pmd-scala/pom.xml | 2 +- pmd-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-vm/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 40 files changed, 42 insertions(+), 42 deletions(-) diff --git a/pmd-apex-jorje/pom.xml b/pmd-apex-jorje/pom.xml index 84426557ab..d7a41e7135 100644 --- a/pmd-apex-jorje/pom.xml +++ b/pmd-apex-jorje/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index a9b5a55b6d..094509a69b 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 601b30e6d0..c9ce000375 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 61109815fa..52d598a518 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index eafaf31eff..6f5c2112d3 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 29115f7c74..2457e736fa 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index c54e2240b2..76d47efa96 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 60d1f88b7b..bd357eec8c 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 254dfff61f..7635dfe896 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index f530235056..752c3c2490 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index f09ed2d027..1db3768bcc 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index ad8a8ab254..c70e3fb4ed 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index b12432e9cb..9313563f85 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index c7d75a6313..1792f879ab 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-java8/pom.xml b/pmd-java8/pom.xml index 15441bc113..243faebe92 100644 --- a/pmd-java8/pom.xml +++ b/pmd-java8/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 998bed876d..cafebcdd9c 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index afe8674dc6..70ef30a40e 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index 7cc60ed98a..58fcf5c655 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index e0c19ba30c..7b92eba63b 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index fde7a0b8c4..4799495af7 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 99099d7f60..9c3a496847 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 7baa043ff8..29f29e36d3 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index e35736b8a2..ac930b3f18 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 7874310b95..5068b49eb5 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 248dc65bd8..b802f45f93 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index ab14374a71..3b4bc8bc77 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 4a19cebaf2..1f90feec8f 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 12edeee182..17f60bc653 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index e2bd003a59..16100c631a 100644 --- a/pmd-scala-modules/pmd-scala-common/pom.xml +++ b/pmd-scala-modules/pmd-scala-common/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../../pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.12/pom.xml b/pmd-scala-modules/pmd-scala_2.12/pom.xml index 810fd29784..c926cd2d3f 100644 --- a/pmd-scala-modules/pmd-scala_2.12/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.12/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.55.0 + 6.56.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala-modules/pmd-scala_2.13/pom.xml b/pmd-scala-modules/pmd-scala_2.13/pom.xml index 7b638624c2..e3e223787c 100644 --- a/pmd-scala-modules/pmd-scala_2.13/pom.xml +++ b/pmd-scala-modules/pmd-scala_2.13/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd-scala-common - 6.55.0 + 6.56.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-scala/pom.xml b/pmd-scala/pom.xml index 6be1e52b24..05a8044370 100644 --- a/pmd-scala/pom.xml +++ b/pmd-scala/pom.xml @@ -9,7 +9,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index c04becb5ea..c24b2bf716 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 3bb010f741..faba7f8e58 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 64ffa61da4..4edda37055 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 5046416655..c0745f24ac 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 3e7c9cb8e0..629c62252c 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-vm/pom.xml b/pmd-vm/pom.xml index d8867d1e4b..c8b0793d1a 100644 --- a/pmd-vm/pom.xml +++ b/pmd-vm/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 25feaee24a..343e3a703a 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index a6c6c28c9a..4cdf2ff08b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 6.55.0 + 6.56.0-SNAPSHOT pom PMD @@ -60,7 +60,7 @@ scm:git:git://github.com/pmd/pmd.git scm:git:ssh://git@github.com/pmd/pmd.git https://github.com/pmd/pmd - pmd_releases/6.55.0 + HEAD @@ -81,7 +81,7 @@ - 2023-02-25T10:38:58Z + 2023-02-25T10:50:54Z 7 From 39f26bdd0b4d4d0c2e3282e837cf0471e0614bfd Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 25 Feb 2023 11:52:24 +0100 Subject: [PATCH 61/70] Prepare next development version [skip ci] --- docs/_config.yml | 6 +-- docs/pages/release_notes.md | 57 ---------------------- docs/pages/release_notes_old.md | 84 +++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 60 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 83ce3a0d05..bd5007f758 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,9 +1,9 @@ repository: pmd/pmd pmd: - version: 6.55.0 - previous_version: 6.54.0 - date: 25-February-2023 + version: 6.56.0-SNAPSHOT + previous_version: 6.55.0 + date: 25-March-2023 release_type: minor # release types: major, minor, bugfix diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 123f813c6e..b8f8783555 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,68 +14,11 @@ This is a {{ site.pmd.release_type }} release. ### New and noteworthy -#### PMD 7 Development -This release is the last planned release of PMD 6. The first version 6.0.0 was released in December 2017. -Over the course of more than 5 years we published almost every month a new minor version of PMD 6 -with new features and improvements. - -Already in November 2018 we started in parallel the development of the next major version 7.0.0, -and we are now in the process of finalizing the scope of the major version. We want to release a couple of -release candidates before publishing the final version 7.0.0. - -We plan to release 7.0.0-rc1 soon. You can see the progress in [PMD 7 Tracking Issue #3898](https://github.com/pmd/pmd/issues/3898). - -#### Java 20 Support -This release of PMD brings support for Java 20. There are no new standard language features. - -PMD supports [JEP 433: Pattern Matching for switch (Fourth Preview)](https://openjdk.org/jeps/433) and -[JEP 432: Record Patterns (Second Preview)](https://openjdk.org/jeps/432) as preview language features. - -In order to analyze a project with PMD that uses these language features, -you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language -version `20-preview`: - - export PMD_JAVA_OPTS=--enable-preview - ./run.sh pmd --use-version java-20-preview ... - -#### T-SQL support -Thanks to the contribution from [Paul Guyot](https://github.com/pguyot) PMD now has CPD support -for T-SQL (Transact-SQL). - -Being based on a proper Antlr grammar, CPD can: - -* ignore comments -* honor [comment-based suppressions](pmd_userdocs_cpd.html#suppression) - ### Fixed Issues -* core - * [#4395](https://github.com/pmd/pmd/issues/4395): \[core] Support environment variable CLASSPATH with pmd.bat under Windows -* java - * [#4333](https://github.com/pmd/pmd/issues/4333): \[java] Support JDK 20 -* java-errorprone - * [#4393](https://github.com/pmd/pmd/issues/4393): \[java] MissingStaticMethodInNonInstantiatableClass false-positive for Lombok's @UtilityClass for classes with non-private fields ### API Changes -#### Go -* The LanguageModule of Go, that only supports CPD execution, has been deprecated. This language - is not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is - not affected by this change. The following class has been deprecated and will be removed with PMD 7.0.0: - * {% jdoc go::lang.go.GoLanguageModule %} - -#### Java -* Support for Java 18 preview language features have been removed. The version "18-preview" is no longer available. -* The experimental class `net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern` has been removed. - ### External Contributions -* [#4384](https://github.com/pmd/pmd/pull/4384): \[swift] Add more swift 5.x support (#unavailable mainly) - [Richard B.](https://github.com/kenji21) (@kenji21) -* [#4390](https://github.com/pmd/pmd/pull/4390): Add support for T-SQL using Antlr4 lexer - [Paul Guyot](https://github.com/pguyot) (@pguyot) -* [#4392](https://github.com/pmd/pmd/pull/4392): \[java] Fix #4393 MissingStaticMethodInNonInstantiatableClass: Fix false-positive for field-only class - [Dawid Ciok](https://github.com/dawiddc) (@dawiddc) - -### Stats -* 40 commits -* 11 closed tickets & PRs -* Days since last release: 28 {% endtocmaker %} diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index 833117888e..78c3ec4ec0 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,90 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: https://github.com/pmd/pmd/releases +## 25-February-2023 - 6.55.0 + +The PMD team is pleased to announce PMD 6.55.0. + +This is a minor release. + +### Table Of Contents + +* [New and noteworthy](#new-and-noteworthy) + * [PMD 7 Development](#pmd-7-development) + * [Java 20 Support](#java-20-support) + * [T-SQL support](#t-sql-support) +* [Fixed Issues](#fixed-issues) +* [API Changes](#api-changes) + * [Go](#go) + * [Java](#java) +* [External Contributions](#external-contributions) +* [Stats](#stats) + +### New and noteworthy + +#### PMD 7 Development +This release is the last planned release of PMD 6. The first version 6.0.0 was released in December 2017. +Over the course of more than 5 years we published almost every month a new minor version of PMD 6 +with new features and improvements. + +Already in November 2018 we started in parallel the development of the next major version 7.0.0, +and we are now in the process of finalizing the scope of the major version. We want to release a couple of +release candidates before publishing the final version 7.0.0. + +We plan to release 7.0.0-rc1 soon. You can see the progress in [PMD 7 Tracking Issue #3898](https://github.com/pmd/pmd/issues/3898). + +#### Java 20 Support +This release of PMD brings support for Java 20. There are no new standard language features. + +PMD supports [JEP 433: Pattern Matching for switch (Fourth Preview)](https://openjdk.org/jeps/433) and +[JEP 432: Record Patterns (Second Preview)](https://openjdk.org/jeps/432) as preview language features. + +In order to analyze a project with PMD that uses these language features, +you'll need to enable it via the environment variable `PMD_JAVA_OPTS` and select the new language +version `20-preview`: + + export PMD_JAVA_OPTS=--enable-preview + ./run.sh pmd --use-version java-20-preview ... + +#### T-SQL support +Thanks to the contribution from [Paul Guyot](https://github.com/pguyot) PMD now has CPD support +for T-SQL (Transact-SQL). + +Being based on a proper Antlr grammar, CPD can: + +* ignore comments +* honor [comment-based suppressions](pmd_userdocs_cpd.html#suppression) + +### Fixed Issues +* core + * [#4395](https://github.com/pmd/pmd/issues/4395): \[core] Support environment variable CLASSPATH with pmd.bat under Windows +* java + * [#4333](https://github.com/pmd/pmd/issues/4333): \[java] Support JDK 20 +* java-errorprone + * [#4393](https://github.com/pmd/pmd/issues/4393): \[java] MissingStaticMethodInNonInstantiatableClass false-positive for Lombok's @UtilityClass for classes with non-private fields + +### API Changes + +#### Go +* The LanguageModule of Go, that only supports CPD execution, has been deprecated. This language + is not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is + not affected by this change. The following class has been deprecated and will be removed with PMD 7.0.0: + * GoLanguageModule + +#### Java +* Support for Java 18 preview language features have been removed. The version "18-preview" is no longer available. +* The experimental class `net.sourceforge.pmd.lang.java.ast.ASTGuardedPattern` has been removed. + +### External Contributions +* [#4384](https://github.com/pmd/pmd/pull/4384): \[swift] Add more swift 5.x support (#unavailable mainly) - [Richard B.](https://github.com/kenji21) (@kenji21) +* [#4390](https://github.com/pmd/pmd/pull/4390): Add support for T-SQL using Antlr4 lexer - [Paul Guyot](https://github.com/pguyot) (@pguyot) +* [#4392](https://github.com/pmd/pmd/pull/4392): \[java] Fix #4393 MissingStaticMethodInNonInstantiatableClass: Fix false-positive for field-only class - [Dawid Ciok](https://github.com/dawiddc) (@dawiddc) + +### Stats +* 40 commits +* 11 closed tickets & PRs +* Days since last release: 28 + ## 28-January-2023 - 6.54.0 The PMD team is pleased to announce PMD 6.54.0. From be4dd9cef09564757927f0e71d211ab448bd45c5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sat, 25 Feb 2023 11:55:26 +0100 Subject: [PATCH 62/70] Bump pmd from 6.54.0 to 6.55.0 --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 4cdf2ff08b..2e1da033b7 100644 --- a/pom.xml +++ b/pom.xml @@ -432,22 +432,22 @@ net.sourceforge.pmd pmd-core - 6.54.0 + 6.55.0 net.sourceforge.pmd pmd-java - 6.54.0 + 6.55.0 net.sourceforge.pmd pmd-jsp - 6.54.0 + 6.55.0 net.sourceforge.pmd pmd-javascript - 6.54.0 + 6.55.0 From 2b35ef298525aa77c4e6b58b2e94f996abaaeb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 25 Feb 2023 13:46:30 -0300 Subject: [PATCH 63/70] Simplify top-level class expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clément Fournier --- pmd-java/src/main/resources/category/java/errorprone.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/main/resources/category/java/errorprone.xml b/pmd-java/src/main/resources/category/java/errorprone.xml index 911b5fe7c9..c141a2eb81 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2351,7 +2351,7 @@ See the property `annotations`. Date: Sun, 26 Feb 2023 14:57:39 +0100 Subject: [PATCH 64/70] Adapt CI to build in merge queue See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6cef3ea71..6cfc36d3c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: tags: - '**' pull_request: + merge_group: schedule: # build it monthly: At 04:00 on day-of-month 1. - cron: '0 4 1 * *' From 50577f2b4042998ac8f4d50781abf3310fb9ac80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 15:33:36 +0100 Subject: [PATCH 65/70] Rewrite binaryDistributionIt to be easier to maintain --- .../java/net/sourceforge/pmd/PMDVersion.java | 2 +- .../net/sourceforge/pmd/it/AllRulesIT.java | 5 +- .../java/net/sourceforge/pmd/it/AntIT.java | 9 +- .../pmd/it/BinaryDistributionIT.java | 135 +++++++++++------- .../sourceforge/pmd/it/ExecutionResult.java | 118 ++++----------- 5 files changed, 122 insertions(+), 147 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java b/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java index 96565eca93..d7391eb7e5 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java @@ -23,7 +23,7 @@ public final class PMDVersion { */ public static final String VERSION; - private static final String UNKNOWN_VERSION = "unknown"; + private static final String UNKNOWN_VERSION = "7.0.0-SNAPSHOT"; /** * Determines the version from maven's generated pom.properties file. diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java index 74faa00fbc..9a32b681a1 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AllRulesIT.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.it; +import static org.hamcrest.Matchers.containsString; + import java.io.File; import java.util.Arrays; @@ -30,7 +32,8 @@ class AllRulesIT extends AbstractBinaryDistributionTest { } private static void assertDefaultExecutionResult(ExecutionResult result) { - result.assertExecutionResult(4, ""); + result.assertExitCode(4) + .assertStdOut(containsString("")); result.assertNoError("Exception applying rule"); result.assertNoError("Ruleset not found"); diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java index f28e430273..bc4ca8be7d 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.it; +import static org.hamcrest.Matchers.containsString; + import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -38,8 +40,11 @@ class AntIT extends AbstractBinaryDistributionTest { File antTestProjectFolder = prepareAntTestProjectFolder(); ExecutionResult result = runAnt(antBasepath, pmdHome, antTestProjectFolder); - result.assertExecutionResult(0, "BUILD SUCCESSFUL"); - result.assertExecutionResult(0, "NoPackage"); // the no package rule + result.assertExitCode(0) + .assertStdOut(containsString("BUILD SUCCESSFUL")); + // the no package rule + result.assertExitCode(0) + .assertStdOut(containsString("NoPackage")); } diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java index 61140975cf..4ecee48c31 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java @@ -4,6 +4,9 @@ package net.sourceforge.pmd.it; +import static net.sourceforge.pmd.util.CollectionUtil.listOf; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.matchesRegex; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -11,7 +14,10 @@ import java.io.File; import java.io.IOException; import java.util.Enumeration; import java.util.HashSet; +import java.util.List; import java.util.Set; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -21,43 +27,50 @@ import net.sourceforge.pmd.PMDVersion; class BinaryDistributionIT extends AbstractBinaryDistributionTest { - private static final String SUPPORTED_LANGUAGES_CPD; - private static final String SUPPORTED_LANGUAGES_PMD; + private static final List SUPPORTED_LANGUAGES_CPD = listOf( + "apex", "cpp", "cs", "dart", "ecmascript", + "fortran", "gherkin", "go", "groovy", "html", "java", "jsp", + "kotlin", "lua", "matlab", "modelica", "objectivec", "perl", + "php", "plsql", "python", "ruby", "scala", "swift", "tsql", + "vf", "xml" + ); + + private static final List SUPPORTED_LANGUAGES_PMD = listOf( + "apex-52", "apex-53", "apex-54", "apex-55", + "apex-56", "apex-57", "ecmascript-3", "ecmascript-5", + "ecmascript-6", "ecmascript-7", "ecmascript-8", + "ecmascript-9", "ecmascript-ES2015", + "ecmascript-ES2016", "ecmascript-ES2017", + "ecmascript-ES2018", "ecmascript-ES6", "html-4", + "html-5", "java-1.10", "java-1.3", "java-1.4", "java-1.5", + "java-1.6", "java-1.7", "java-1.8", "java-1.9", "java-10", + "java-11", "java-12", "java-13", "java-14", "java-15", + "java-16", "java-17", "java-18", "java-19", + "java-19-preview", "java-20", "java-20-preview", + "java-5", "java-6", "java-7", + "java-8", "java-9", "jsp-2", "jsp-3", "kotlin-1.6", + "kotlin-1.7", "modelica-3.4", "modelica-3.5", + "plsql-11g", "plsql-12.1", "plsql-12.2", + "plsql-12c_Release_1", "plsql-12c_Release_2", + "plsql-18c", "plsql-19c", "plsql-21c", "pom-4.0.0", + "scala-2.10", "scala-2.11", "scala-2.12", "scala-2.13", + "swift-4.2", "swift-5.0", "swift-5.1", "swift-5.2", + "swift-5.3", "swift-5.4", "swift-5.5", "swift-5.6", + "swift-5.7", "vf-52", "vf-53", "vf-54", "vf-55", "vf-56", + "vf-57", "vm-2.0", "vm-2.1", "vm-2.2", "vm-2.3", "wsdl-1.1", + "wsdl-2.0", "xml-1.0", "xml-1.1", "xsl-1.0", "xsl-2.0", + "xsl-3.0" + ); - static { - SUPPORTED_LANGUAGES_CPD = "Valid values: apex, cpp, cs, dart, ecmascript," + System.lineSeparator() - + " fortran, gherkin, go, groovy, html, java, jsp," + System.lineSeparator() - + " kotlin, lua, matlab, modelica, objectivec, perl," + System.lineSeparator() - + " php, plsql, python, ruby, scala, swift, tsql," + System.lineSeparator() - + " vf, xml"; - SUPPORTED_LANGUAGES_PMD = "Valid values: apex-52, apex-53, apex-54, apex-55," + System.lineSeparator() - + " apex-56, apex-57, ecmascript-3, ecmascript-5," + System.lineSeparator() - + " ecmascript-6, ecmascript-7, ecmascript-8," + System.lineSeparator() - + " ecmascript-9, ecmascript-ES2015," + System.lineSeparator() - + " ecmascript-ES2016, ecmascript-ES2017," + System.lineSeparator() - + " ecmascript-ES2018, ecmascript-ES6, html-4," + System.lineSeparator() - + " html-5, java-1.10, java-1.3, java-1.4, java-1.5," + System.lineSeparator() - + " java-1.6, java-1.7, java-1.8, java-1.9, java-10," + System.lineSeparator() - + " java-11, java-12, java-13, java-14, java-15," + System.lineSeparator() - + " java-16, java-17, java-18, java-19," + System.lineSeparator() - + " java-19-preview, java-20, java-20-preview," + System.lineSeparator() - + " java-5, java-6, java-7," - + " java-8, java-9, jsp-2, jsp-3, kotlin-1.6," + System.lineSeparator() - + " kotlin-1.7, modelica-3.4, modelica-3.5," + System.lineSeparator() - + " plsql-11g, plsql-12.1, plsql-12.2," + System.lineSeparator() - + " plsql-12c_Release_1, plsql-12c_Release_2," + System.lineSeparator() - + " plsql-18c, plsql-19c, plsql-21c, pom-4.0.0," + System.lineSeparator() - + " scala-2.10, scala-2.11, scala-2.12, scala-2.13," + System.lineSeparator() - + " swift-4.2, swift-5.0, swift-5.1, swift-5.2," + System.lineSeparator() - + " swift-5.3, swift-5.4, swift-5.5, swift-5.6," + System.lineSeparator() - + " swift-5.7, vf-52, vf-53, vf-54, vf-55, vf-56," + System.lineSeparator() - + " vf-57, vm-2.0, vm-2.1, vm-2.2, vm-2.3, wsdl-1.1," + System.lineSeparator() - + " wsdl-2.0, xml-1.0, xml-1.1, xsl-1.0, xsl-2.0," + System.lineSeparator() - + " xsl-3.0"; - } private final String srcDir = new File(".", "src/test/resources/sample-source/java/").getAbsolutePath(); + private static Pattern toListPattern(List items) { + String pattern = items.stream().map(Pattern::quote) + .collect(Collectors.joining(",\\s+", ".*Valid values: ", ".*")); + return Pattern.compile(pattern, Pattern.DOTALL); + } + @Test void testFileExistence() { assertTrue(getBinaryDistribution().exists()); @@ -99,46 +112,49 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest { @Test void testPmdJavaQuickstart() throws Exception { ExecutionResult result = PMDExecutor.runPMDRules(createTemporaryReportFile(), tempDir, srcDir, "rulesets/java/quickstart.xml"); - result.assertExecutionResult(4, ""); + result.assertExitCode(4) + .assertStdOut(containsString("")); } @Test void testPmdXmlFormat() throws Exception { ExecutionResult result = PMDExecutor.runPMDRules(createTemporaryReportFile(), tempDir, srcDir, "src/test/resources/rulesets/sample-ruleset.xml", "xml"); - result.assertExecutionResult(4, "", "JumbledIncrementer.java\">"); - result.assertExecutionResult(4, "", "")); + result.assertExitCode(4).assertReport(containsString(""); - result.assertExecutionResult(4, "Class1.java\"/>"); - result.assertExecutionResult(4, "Class2.java\"/>"); + result.assertExitCode(4) + .assertStdOut(containsString("")); + result.assertExitCode(4) + .assertStdOut(containsString("Class1.java\"/>")); + result.assertExitCode(4) + .assertStdOut(containsString("Class2.java\"/>")); result = CpdExecutor.runCpd(tempDir, "--minimum-tokens", "1000", "--format", "text", "--dir", srcDir); - result.assertExecutionResult(0); + result.assertExitCode(0); } } diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java index ee00990309..d182e83d8c 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/ExecutionResult.java @@ -4,13 +4,12 @@ package net.sourceforge.pmd.it; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; 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.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; -import net.sourceforge.pmd.PMD; +import org.hamcrest.Matcher; /** * Collects the result of a command execution in order to verify it. @@ -32,96 +31,40 @@ public class ExecutionResult { @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("ExecutionResult:") - .append(PMD.EOL) - .append(" exit code: ").append(exitCode).append(PMD.EOL) - .append(" output:").append(PMD.EOL).append(output).append(PMD.EOL) - .append(" errorOutput:").append(PMD.EOL).append(errorOutput).append(PMD.EOL) - .append(" report:").append(PMD.EOL).append(report).append(PMD.EOL); - return sb.toString(); + return "ExecutionResult:\n" + + " exit code: " + exitCode + "\n" + + " output:\n" + output + "\n" + + " errorOutput:\n" + errorOutput + "\n" + + " report:\n" + report + "\n"; } - /** - * Asserts that the command exited with the expected exit code. Any output is ignored. - * - * @param expectedExitCode the exit code, e.g. 0 if no rule violations are expected, or 4 if violations are found - */ - public void assertExecutionResult(int expectedExitCode) { - assertExecutionResult(expectedExitCode, null); - } - - /** - * Asserts that the command exited with the expected exit code and that the given expected - * output is contained in the actual command output. - * - * @param expectedExitCode the exit code, e.g. 0 if no rule violations are expected, or 4 if violations are found - * @param expectedOutput the output to search for - */ - public void assertExecutionResult(int expectedExitCode, String expectedOutput) { - assertExecutionResult(expectedExitCode, expectedOutput, null); - } - - /** - * Asserts that the command exited with the expected exit code and that the given expected - * output is contained in the actual command output and the given expected report is in the - * generated report. - * - * @param expectedExitCode the exit code, e.g. 0 if no rule violations are expected, or 4 if violations are found - * @param expectedOutput the output to search for - * @param expectedReport the string to search for tin the report - */ - public void assertExecutionResult(int expectedExitCode, String expectedOutput, String expectedReport) { - assertExecResultImpl(expectedExitCode, output, expectedOutput, expectedReport); - } - - /** - * Asserts that the command exited with the expected exit code and that the given expected - * output is contained in the actual command ERROR output, and the given expected report is in the - * generated report. - * - * @param expectedExitCode the exit code, e.g. 0 if no rule violations are expected, or 4 if violations are found - * @param expectedErrorOutput the output to search for in stderr - * @param expectedReport the string to search for tin the report - */ - public void assertExecutionResultErrOutput(int expectedExitCode, String expectedErrorOutput, String expectedReport) { - assertExecResultImpl(expectedExitCode, errorOutput, expectedErrorOutput, expectedReport); - } - - /** - * Asserts that the command exited with the expected exit code and that the given expected - * output is contained in the actual command ERROR output. - * - * @param expectedExitCode the exit code, e.g. 0 if no rule violations are expected, or 4 if violations are found - * @param expectedErrorOutput the output to search for in stderr - */ - public void assertExecutionResultErrOutput(int expectedExitCode, String expectedErrorOutput) { - assertExecResultImpl(expectedExitCode, errorOutput, expectedErrorOutput, null); - } - - private void assertExecResultImpl(int expectedExitCode, String output, String expectedOutput, String expectedReport) { + public ExecutionResult assertExitCode(int expectedExitCode) { assertEquals(expectedExitCode, exitCode, "Command exited with wrong code.\nComplete result:\n\n" + this); - assertNotNull(output, "No output found"); - if (expectedOutput != null && !expectedOutput.isEmpty()) { - if (!output.contains(expectedOutput)) { - fail("Expected output '" + expectedOutput + "' not present.\nComplete result:\n\n" + this); - } - } else if (expectedOutput != null && expectedOutput.isEmpty()) { - assertTrue(output.isEmpty(), "The output should have been empty.\nComplete result:\n\n" + this); - } - if (expectedReport != null && !expectedReport.isEmpty()) { - assertTrue(report.contains(expectedReport), - "Expected report '" + expectedReport + "'.\nComplete result:\n\n" + this); - } + return this; + } + + public ExecutionResult assertReport(Matcher reportMatcher) { + assertThat("Report", report, reportMatcher); + return this; + } + + public ExecutionResult assertStdErr(Matcher matcher) { + assertThat("Standard error", errorOutput, matcher); + return this; + } + + public ExecutionResult assertStdOut(Matcher matcher) { + assertThat("Standard output", output, matcher); + return this; } /** * Asserts that the given error message is not in the error output. + * * @param errorMessage the error message to search for */ public void assertNoError(String errorMessage) { - assertFalse(errorOutput.contains(errorMessage), - "Found error message: " + errorMessage + ".\nComplete result:\n\n" + this); + assertStdErr(not(containsString(errorMessage))); } /** @@ -129,12 +72,11 @@ public class ExecutionResult { * @param errorMessage the error message to search for */ public void assertNoErrorInReport(String errorMessage) { - assertFalse(report.contains(errorMessage), - "Found error message in report: " + errorMessage + ".\nComplete result:\n\n" + this); + assertReport(not(containsString(errorMessage))); } public void assertErrorOutputContains(String message) { - assertTrue(errorOutput.contains(message), "erroroutput didn't contain " + message); + assertStdErr(containsString(message)); } static class Builder { From 71dbeb2acd998e89c482ab7c2f26c2318789dfc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 15:35:28 +0100 Subject: [PATCH 66/70] Revert version change --- pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java b/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java index d7391eb7e5..96565eca93 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PMDVersion.java @@ -23,7 +23,7 @@ public final class PMDVersion { */ public static final String VERSION; - private static final String UNKNOWN_VERSION = "7.0.0-SNAPSHOT"; + private static final String UNKNOWN_VERSION = "unknown"; /** * Determines the version from maven's generated pom.properties file. From 778d5e843ac5c41f78fdc61908596741c8d981ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 15:40:14 +0100 Subject: [PATCH 67/70] Cleanups --- .../sourceforge/pmd/cache/CachedRuleViolation.java | 12 ++++++------ .../net/sourceforge/pmd/cache/FileAnalysisCache.java | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java index 4bc38ecbeb..13f7504b08 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/CachedRuleViolation.java @@ -41,20 +41,20 @@ public final class CachedRuleViolation implements RuleViolation { private FileLocation location; private CachedRuleViolation(final CachedRuleMapper mapper, final String description, - final String fileName, final String ruleClassName, final String ruleName, + final String filePathId, final String ruleClassName, final String ruleName, final String ruleTargetLanguage, final int beginLine, final int beginColumn, final int endLine, final int endColumn, final Map additionalInfo) { this.mapper = mapper; this.description = description; - this.location = FileLocation.range(fileName, TextRange2d.range2d(beginLine, beginColumn, endLine, endColumn)); + this.location = FileLocation.range(filePathId, TextRange2d.range2d(beginLine, beginColumn, endLine, endColumn)); this.ruleClassName = ruleClassName; this.ruleName = ruleName; this.ruleTargetLanguage = ruleTargetLanguage; this.additionalInfo = additionalInfo; } - public void setFileDisplayName(String displayName) { + void setFileDisplayName(String displayName) { this.location = FileLocation.range(displayName, TextRange2d.range2d(getBeginLine(), getBeginColumn(), getEndLine(), getEndColumn())); } @@ -84,13 +84,13 @@ public final class CachedRuleViolation implements RuleViolation { * Helper method to load a {@link CachedRuleViolation} from an input stream. * * @param stream The stream from which to load the violation. - * @param fileName The name of the file on which this rule was reported. + * @param filePathId The name of the file on which this rule was reported. * @param mapper The mapper to be used to obtain rule instances from the active rulesets. * @return The loaded rule violation. * @throws IOException */ /* package */ static CachedRuleViolation loadFromStream(final DataInputStream stream, - final String fileName, final CachedRuleMapper mapper) throws IOException { + final String filePathId, final CachedRuleMapper mapper) throws IOException { final String description = stream.readUTF(); final String ruleClassName = stream.readUTF(); final String ruleName = stream.readUTF(); @@ -100,7 +100,7 @@ public final class CachedRuleViolation implements RuleViolation { final int endLine = stream.readInt(); final int endColumn = stream.readInt(); final Map additionalInfo = readAdditionalInfo(stream); - return new CachedRuleViolation(mapper, description, fileName, ruleClassName, ruleName, ruleTargetLanguage, + return new CachedRuleViolation(mapper, description, filePathId, ruleClassName, ruleName, ruleTargetLanguage, beginLine, beginColumn, endLine, endColumn, additionalInfo); } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java index 6f61898d9d..17325c6ffa 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java @@ -74,16 +74,16 @@ public class FileAnalysisCache extends AbstractAnalysisCache { // Cached results while (inputStream.available() > 0) { - final String fileName = inputStream.readUTF(); + final String filePathId = inputStream.readUTF(); final long checksum = inputStream.readLong(); final int countViolations = inputStream.readInt(); final List violations = new ArrayList<>(countViolations); for (int i = 0; i < countViolations; i++) { - violations.add(CachedRuleViolation.loadFromStream(inputStream, fileName, ruleMapper)); + violations.add(CachedRuleViolation.loadFromStream(inputStream, filePathId, ruleMapper)); } - fileResultsCache.put(fileName, new AnalysisResult(checksum, violations)); + fileResultsCache.put(filePathId, new AnalysisResult(checksum, violations)); } LOG.info("Analysis cache loaded"); From 9e43640834f0bdd4c52c6b16843ae3c4709a6e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 15:43:19 +0100 Subject: [PATCH 68/70] Change cache log messages to be debug/trace --- .../sourceforge/pmd/cache/AbstractAnalysisCache.java | 10 +++++----- .../net/sourceforge/pmd/cache/FileAnalysisCache.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java index 81ae8ab342..a70042753e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java @@ -74,7 +74,7 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { && cachedResult.getFileChecksum() == document.getCheckSum(); if (upToDate) { - LOG.debug("Incremental Analysis cache HIT"); + LOG.trace("Incremental Analysis cache HIT"); /* * Update cached violation "filename" to match the appropriate text document, @@ -86,7 +86,7 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { // copy results over updatedResult = cachedResult; } else { - LOG.debug("Incremental Analysis cache MISS - {}", + LOG.trace("Incremental Analysis cache MISS - {}", cachedResult != null ? "file changed" : "no previous result found"); // New file being analyzed, create new empty entry @@ -130,7 +130,7 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { boolean cacheIsValid = cacheExists(); if (cacheIsValid && ruleSets.getChecksum() != rulesetChecksum) { - LOG.info("Analysis cache invalidated, rulesets changed."); + LOG.debug("Analysis cache invalidated, rulesets changed."); cacheIsValid = false; } @@ -142,7 +142,7 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { if (cacheIsValid && currentAuxClassPathChecksum != auxClassPathChecksum) { // TODO some rules don't need that (in fact, some languages) - LOG.info("Analysis cache invalidated, auxclasspath changed."); + LOG.debug("Analysis cache invalidated, auxclasspath changed."); cacheIsValid = false; } } else { @@ -151,7 +151,7 @@ public abstract class AbstractAnalysisCache implements AnalysisCache { final long currentExecutionClassPathChecksum = FINGERPRINTER.fingerprint(getClassPathEntries()); if (cacheIsValid && currentExecutionClassPathChecksum != executionClassPathChecksum) { - LOG.info("Analysis cache invalidated, execution classpath changed."); + LOG.debug("Analysis cache invalidated, execution classpath changed."); cacheIsValid = false; } diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java index 17325c6ffa..630dbf3093 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java @@ -86,9 +86,9 @@ public class FileAnalysisCache extends AbstractAnalysisCache { fileResultsCache.put(filePathId, new AnalysisResult(checksum, violations)); } - LOG.info("Analysis cache loaded"); + LOG.debug("Analysis cache loaded from {}", cacheFile); } else { - LOG.info("Analysis cache invalidated, PMD version changed."); + LOG.debug("Analysis cache invalidated, PMD version changed."); } } catch (final EOFException e) { LOG.warn("Cache file {} is malformed, will not be used for current analysis", cacheFile.getPath()); @@ -141,9 +141,9 @@ public class FileAnalysisCache extends AbstractAnalysisCache { } } if (cacheFileShouldBeCreated) { - LOG.info("Analysis cache created"); + LOG.debug("Analysis cache created"); } else { - LOG.info("Analysis cache updated"); + LOG.debug("Analysis cache updated"); } } catch (final IOException e) { LOG.error("Could not persist analysis cache to file: {}", e.getMessage()); From 22871ad03c5a52edf3acf0d571db80e69cf66a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 16:06:01 +0100 Subject: [PATCH 69/70] add a test for display name in the cache --- .../pmd/cache/FileAnalysisCacheTest.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java index 2a520a8e05..9424c3be2f 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/cache/FileAnalysisCacheTest.java @@ -43,6 +43,7 @@ import net.sourceforge.pmd.lang.document.TextDocument; import net.sourceforge.pmd.lang.document.TextFile; import net.sourceforge.pmd.lang.document.TextFileContent; import net.sourceforge.pmd.lang.document.TextRange2d; +import net.sourceforge.pmd.lang.rule.ParametricRuleViolation; import net.sourceforge.pmd.reporting.FileAnalysisListener; class FileAnalysisCacheTest { @@ -142,6 +143,57 @@ class FileAnalysisCacheTest { assertEquals(textLocation.getEndColumn(), cachedViolation.getEndColumn()); } + + @Test + void testDisplayNameIsRespected() throws Exception { + // This checks that the display name of the file is respected even if + // the file is assigned a different display name across runs. The path + // id is saved into the cache file, and the cache implementation updates the + // display name of the violations to match their current display name. + + final net.sourceforge.pmd.Rule rule = mock(net.sourceforge.pmd.Rule.class, Mockito.RETURNS_SMART_NULLS); + when(rule.getLanguage()).thenReturn(mock(Language.class)); + + final TextRange2d textLocation = TextRange2d.range2d(1, 2, 3, 4); + + TextFile mockFile = mock(TextFile.class); + when(mockFile.getDisplayName()).thenReturn("display0"); + when(mockFile.getPathId()).thenReturn("pathId"); + when(mockFile.getLanguageVersion()).thenReturn(dummyVersion); + when(mockFile.readContents()).thenReturn(TextFileContent.fromCharSeq("abc")); + + final FileAnalysisCache cache = new FileAnalysisCache(newCacheFile); + cache.checkValidity(mock(RuleSets.class), mock(ClassLoader.class)); + + try (TextDocument doc0 = TextDocument.create(mockFile)) { + cache.isUpToDate(doc0); + try (FileAnalysisListener listener = cache.startFileAnalysis(doc0)) { + listener.onRuleViolation(new ParametricRuleViolation(rule, FileLocation.range(doc0.getDisplayName(), textLocation), "message")); + } + } finally { + cache.persist(); + } + + reloadWithOneViolation(mockFile); + // now try with another display name + when(mockFile.getDisplayName()).thenReturn("display2"); + reloadWithOneViolation(mockFile); + } + + private void reloadWithOneViolation(TextFile mockFile) throws IOException { + final FileAnalysisCache reloadedCache = new FileAnalysisCache(newCacheFile); + reloadedCache.checkValidity(mock(RuleSets.class), mock(ClassLoader.class)); + try (TextDocument doc1 = TextDocument.create(mockFile)) { + assertTrue(reloadedCache.isUpToDate(doc1), + "Cache believes unmodified file with violations is not up to date"); + List cachedViolations = reloadedCache.getCachedViolations(doc1); + assertEquals(1, cachedViolations.size(), "Cached rule violations count mismatch"); + final RuleViolation cachedViolation = cachedViolations.get(0); + assertEquals(mockFile.getDisplayName(), cachedViolation.getFilename()); + } + } + + @Test void testCacheValidityWithNoChanges() throws IOException { final RuleSets rs = mock(RuleSets.class); From bf2c69921e16fc5bd5ca5fe794e93aea6cd6f264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 26 Feb 2023 16:23:12 +0100 Subject: [PATCH 70/70] Fix merge --- .../java/net/sourceforge/pmd/it/AnalysisCacheIT.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java index ef010cb850..b9a4478ec3 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AnalysisCacheIT.java @@ -4,6 +4,7 @@ package net.sourceforge.pmd.it; +import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; @@ -25,7 +26,7 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest { // Ensure we have violations and a non-empty cache file assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run"); - result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t"); + result.assertExitCode(4).assertReport(containsString(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t")); // rerun from cache ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", srcDir, "-R", "src/test/resources/rulesets/sample-ruleset.xml", @@ -45,7 +46,8 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest { // Ensure we have violations and a non-empty cache file assertTrue(cacheFile.toFile().length() > 0, "cache file is empty after run"); - result.assertExecutionResult(4, "", srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t"); + result.assertExitCode(4) + .assertReport(containsString(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t")); // rerun from cache with relativized paths ExecutionResult resultFromCache = PMDExecutor.runPMD(createTemporaryReportFile(), tempDir, "-d", Paths.get(".").toAbsolutePath().relativize(Paths.get(srcDir)).toString(), "-R", "src/test/resources/rulesets/sample-ruleset.xml", @@ -54,7 +56,8 @@ class AnalysisCacheIT extends AbstractBinaryDistributionTest { resultFromCache.assertErrorOutputContains("Incremental Analysis cache HIT"); // An error with the relative path should exist, but no with the absolute one - resultFromCache.assertExecutionResult(4, "", "src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.separatorChar)); + result.assertExitCode(4) + .assertReport(containsString("src/test/resources/sample-source/java/JumbledIncrementer.java:8:\tJumbledIncrementer:\t".replace('/', File.separatorChar))); resultFromCache.assertNoErrorInReport(srcDir + File.separator + "JumbledIncrementer.java:8:\tJumbledIncrementer:\t"); } }