From 53246d584ecf3cf59b1916514984065511a37d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 12 Apr 2024 20:21:32 -0300 Subject: [PATCH 001/121] Support sequences in XPath Attributes --- .../pmd/lang/rule/xpath/impl/AttributeAxisIterator.java | 4 +++- .../pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 46b0dd9f45..83ed8c471f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -14,6 +14,7 @@ import java.lang.invoke.MethodType; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; +import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -119,7 +120,8 @@ public class AttributeAxisIterator implements Iterator { private boolean isConsideredReturnType(Method method) { Class klass = method.getReturnType(); - return CONSIDERED_RETURN_TYPES.contains(klass) || klass.isEnum(); + return CONSIDERED_RETURN_TYPES.contains(klass) || klass.isEnum() + || Collection.class.isAssignableFrom(klass); } private boolean isIgnored(Class nodeClass, Method method) { 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 448791c574..d854f4e9d6 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 @@ -258,13 +258,13 @@ public class SaxonXPathRuleQuery { return NAME_POOL; } - final class StaticContextWithProperties extends IndependentContext { private final Map> propertiesByName = new HashMap<>(); StaticContextWithProperties(Configuration config) { super(config); + getPackageData().setSchemaAware(true); } public void declareProperty(PropertyDescriptor prop) { From a01481a4f33273a992fcd5a1e7d80c2ebc4c3d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 18 Apr 2024 23:29:37 -0300 Subject: [PATCH 002/121] Add test for collection attributes --- .../java/net/sourceforge/pmd/lang/ast/DummyNode.java | 6 ++++++ .../rule/xpath/internal/SaxonXPathRuleQueryTest.java | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyNode.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyNode.java index a67ac6f386..eb4d5b5c96 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyNode.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/ast/DummyNode.java @@ -5,6 +5,7 @@ package net.sourceforge.pmd.lang.ast; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -125,6 +126,11 @@ public class DummyNode extends AbstractNode { return attributes.iterator(); } + // phony attribute that repeats the image 3 times + public List getLines() { + return Arrays.asList(getImage(), getImage(), getImage()); + } + public static class DummyRootNode extends DummyNode implements RootNode, GenericNode { // FIXME remove this 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 42829bbe48..6e91ae77eb 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 @@ -134,6 +134,15 @@ class SaxonXPathRuleQueryTest { assertQuery(0, "(/)[self::document-node(element(DummyNodeX))]", dummy); } + @Test + void testListAttributes() { + DummyRootNode dummy = helper.parse("(a(b))"); + List result = assertQuery(1, + "//dummyNode[count(distinct-values(@Lines)) > 0 and not(empty(index-of(@Lines, 'a')))]", dummy); + + assertEquals(dummy.getChild(0), result.get(0)); + } + @Test void ruleChainVisits() { SaxonXPathRuleQuery query = createQuery("//dummyNode[@Image='baz']/foo | //bar[@Public = 'true'] | //dummyNode[@Public = false()] | //dummyNode"); From f307e6e6cb0544a5a8a20b427f946df23bd9a581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 18 Apr 2024 23:49:35 -0300 Subject: [PATCH 003/121] Update changelog --- docs/pages/release_notes.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index befb4c1200..ab2d0ab991 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -14,6 +14,16 @@ This is a {{ site.pmd.release_type }} release. ### ๐Ÿš€ New and noteworthy +#### Collections exposed as XPath attributes + +Up to now, all AST node getters would be exposed to XPath, as long as the return type was a primitive (boxed or unboxed), String or Enum. That meant that collections, even of these basic types, were not exposed, so for instance accessing Apex's `ASTUserClass.getInterfaceNames()` to list the interfaces implemented by a class was impossible from XPath, and would require writing a Java rule to check it. + +Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` that implements `Queueable`, it is now possible to write: + +```xml +/UserClass[not(empty(index-of(@InterfaceNames, 'Queueable')))] +``` + ### โœจ New rules - The new Java rule {%rule java/bestpractices/UnnecessaryVarargsArrayCreation %} reports explicit array creation From 8db0c80f24c3b1cefd1a146a143ec5fd76df19a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 00:14:11 -0300 Subject: [PATCH 004/121] Restrict exposed attributes based on element types --- .../xpath/impl/AttributeAxisIterator.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 83ed8c471f..4337f25a13 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -13,6 +13,8 @@ import java.lang.invoke.MethodHandles.Lookup; import java.lang.invoke.MethodType; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; @@ -120,8 +122,23 @@ public class AttributeAxisIterator implements Iterator { private boolean isConsideredReturnType(Method method) { Class klass = method.getReturnType(); - return CONSIDERED_RETURN_TYPES.contains(klass) || klass.isEnum() - || Collection.class.isAssignableFrom(klass); + if (CONSIDERED_RETURN_TYPES.contains(klass) || klass.isEnum()) { + return true; + } + + if (Collection.class.isAssignableFrom(klass)) { + Type t = method.getGenericReturnType(); + if (t instanceof ParameterizedType) { + try { + Class elementKlass = Class.forName(((ParameterizedType) t).getActualTypeArguments()[0].getTypeName()); + return CONSIDERED_RETURN_TYPES.contains(elementKlass) || elementKlass.isEnum(); + } catch (ClassNotFoundException ignored) { + // should never happen + } + } + } + + return false; } private boolean isIgnored(Class nodeClass, Method method) { From ce5e229c61f13e12337c7c4521847f22a4551c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 00:28:28 -0300 Subject: [PATCH 005/121] Produce deprecation warnings when atomize is used - When Saxon determines that it needs to atomize an attribute rather than getStringValue() we were not producing deprecation warnings. --- .../pmd/lang/rule/xpath/internal/AstAttributeNode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java index 9cbb199a62..4b6f7f077f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java @@ -68,6 +68,7 @@ class AstAttributeNode extends BaseNodeInfo implements SiblingCountingNode { @Override public AtomicSequence atomize() { + getTreeInfo().getLogger().recordUsageOf(attribute); if (value == null) { value = DomainConversion.convert(attribute.getValue()); } From 8d51a2f2a034d7eec4db4cf8855187b95c969c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 00:31:37 -0300 Subject: [PATCH 006/121] Just do it once per attribute --- .../pmd/lang/rule/xpath/internal/AstAttributeNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java index 4b6f7f077f..7bddc4f9ea 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java @@ -68,8 +68,8 @@ class AstAttributeNode extends BaseNodeInfo implements SiblingCountingNode { @Override public AtomicSequence atomize() { - getTreeInfo().getLogger().recordUsageOf(attribute); if (value == null) { + getTreeInfo().getLogger().recordUsageOf(attribute); value = DomainConversion.convert(attribute.getValue()); } return value; From b74b6e5a666375e16920e3bafb59783d7c662272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 00:46:58 -0300 Subject: [PATCH 007/121] Revert. Different rules on the same node report separately --- .../pmd/lang/rule/xpath/internal/AstAttributeNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java index 7bddc4f9ea..4b6f7f077f 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/AstAttributeNode.java @@ -68,8 +68,8 @@ class AstAttributeNode extends BaseNodeInfo implements SiblingCountingNode { @Override public AtomicSequence atomize() { + getTreeInfo().getLogger().recordUsageOf(attribute); if (value == null) { - getTreeInfo().getLogger().recordUsageOf(attribute); value = DomainConversion.convert(attribute.getValue()); } return value; From 0d6f196c6dbeca13b22d844cb978e658253f8f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:13:21 -0300 Subject: [PATCH 008/121] Fix broken tests --- .../rule/xpath/impl/AttributeAxisIteratorTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIteratorTest.java b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIteratorTest.java index 906b0128de..e674bbe56c 100644 --- a/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIteratorTest.java +++ b/pmd-core/src/test/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIteratorTest.java @@ -41,7 +41,9 @@ class AttributeAxisIteratorTest { AttributeAxisIterator it = new AttributeAxisIterator(dummyNode); - assertEquals(DEFAULT_ATTRS, toMap(it).keySet()); + Set expected = CollectionUtil.setUnion(DEFAULT_ATTRS, "Lines"); + + assertEquals(expected, toMap(it).keySet()); } @Test @@ -50,7 +52,7 @@ class AttributeAxisIteratorTest { AttributeAxisIterator it = new AttributeAxisIterator(dummyNode); - Set expected = CollectionUtil.setUnion(DEFAULT_ATTRS, "Enum"); + Set expected = CollectionUtil.setUnion(DEFAULT_ATTRS, "Enum", "Lines"); assertEquals(expected, toMap(it).keySet()); } @@ -62,7 +64,9 @@ class AttributeAxisIteratorTest { AttributeAxisIterator it = new AttributeAxisIterator(dummyNode); - assertEquals(DEFAULT_ATTRS, toMap(it).keySet()); + Set expected = CollectionUtil.setUnion(DEFAULT_ATTRS, "List", "Lines"); + + assertEquals(expected, toMap(it).keySet()); } /** From 3a4abd720e6f4a18972e14abce61e138c822aa5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:13:37 -0300 Subject: [PATCH 009/121] Schema awareness changes the produced queries --- .../internal/SaxonXPathRuleQueryTest.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) 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 6e91ae77eb..a53ffe4b91 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 @@ -152,11 +152,11 @@ class SaxonXPathRuleQueryTest { assertTrue(ruleChainVisits.contains("bar")); assertEquals(3, query.nodeNameToXPaths.size()); - assertExpression("(self::node()[(string(data(@Image))) eq baz])/child::element(foo)", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("self::node()[(boolean(data(@Public))) eq false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(1)); + assertExpression("(self::node()[(data(attribute::attribute(Image))) = baz])/child::element(foo)", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("self::node()[(data(attribute::attribute(Public))) = false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(1)); assertExpression("self::node()", query.getExpressionsForLocalNameOrDefault("dummyNode").get(2)); - assertExpression("self::node()[(string(data(@Public))) eq true]", query.getExpressionsForLocalNameOrDefault("bar").get(0)); - assertExpression("(((docOrder((((/)/descendant::element(dummyNode))[(string(data(@Image))) eq baz])/child::element(foo))) | (((/)/descendant::element(bar))[(string(data(@Public))) eq true])) | (((/)/descendant::element(dummyNode))[(boolean(data(@Public))) eq false])) | ((/)/descendant::element(dummyNode))", query.getFallbackExpr()); + assertExpression("self::node()[(data(attribute::attribute(Public))) = true]", query.getExpressionsForLocalNameOrDefault("bar").get(0)); + assertExpression("(((docOrder((((/)/descendant::element(dummyNode))[(data(attribute::attribute(Image))) = baz])/child::element(foo))) | (((/)/descendant::element(bar))[(data(attribute::attribute(Public))) = true])) | (((/)/descendant::element(dummyNode))[(data(attribute::attribute(Public))) = false])) | ((/)/descendant::element(dummyNode))", query.getFallbackExpr()); } @Test @@ -166,8 +166,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("(self::node()[(boolean(data(@Test1))) eq false])[(boolean(data(@Test2))) eq true]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("(((/)/descendant::element(dummyNode))[(boolean(data(@Test1))) eq false])[(boolean(data(@Test2))) eq true]", query.getFallbackExpr()); + assertExpression("(self::node()[(data(attribute::attribute(Test1))) = false])[(data(attribute::attribute(Test2))) = true]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("(((/)/descendant::element(dummyNode))[(data(attribute::attribute(Test1))) = false])[(data(attribute::attribute(Test2))) = true]", query.getFallbackExpr()); } @Test @@ -177,8 +177,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("self::node()[Q{http://pmd.sourceforge.net/pmd-dummy}imageIs(exactly-one(convertTo_xs:string(data(@Image))))]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("((/)/descendant::element(Q{}dummyNode))[Q{http://pmd.sourceforge.net/pmd-dummy}imageIs(exactly-one(convertTo_xs:string(data(@Image))))]", query.getFallbackExpr()); + assertExpression("self::node()[Q{http://pmd.sourceforge.net/pmd-dummy}imageIs(exactly-one(convertTo_xs:string(data(attribute::attribute(Image)))))]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("((/)/descendant::element(Q{}dummyNode))[Q{http://pmd.sourceforge.net/pmd-dummy}imageIs(exactly-one(convertTo_xs:string(data(attribute::attribute(Image)))))]", query.getFallbackExpr()); } /** @@ -215,8 +215,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("(((self::node()/child::element(foo))/child::element())/child::element(bar))[(string(data(@Test))) eq false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("docOrder(((docOrder((((/)/descendant::element(dummyNode))/child::element(foo))/child::element()))/child::element(bar))[(string(data(@Test))) eq false])", query.getFallbackExpr()); + assertExpression("(((self::node()/child::element(foo))/child::element())/child::element(bar))[(data(attribute::attribute(Test))) = false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("docOrder(((docOrder((((/)/descendant::element(dummyNode))/child::element(foo))/child::element()))/child::element(bar))[(data(attribute::attribute(Test))) = false])", query.getFallbackExpr()); } @Test @@ -226,8 +226,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("((((self::node()/child::element(foo))[(string(data(@Baz))) eq a])/child::element())/child::element(bar))[(string(data(@Test))) eq false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("docOrder(((docOrder(((((/)/descendant::element(dummyNode))/child::element(foo))[(string(data(@Baz))) eq a])/child::element()))/child::element(bar))[(string(data(@Test))) eq false])", query.getFallbackExpr()); + assertExpression("((((self::node()/child::element(foo))[(data(attribute::attribute(Baz))) = a])/child::element())/child::element(bar))[(data(attribute::attribute(Test))) = false]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("docOrder(((docOrder(((((/)/descendant::element(dummyNode))/child::element(foo))[(data(attribute::attribute(Baz))) = a])/child::element()))/child::element(bar))[(data(attribute::attribute(Test))) = false])", query.getFallbackExpr()); } @Test @@ -249,7 +249,7 @@ class SaxonXPathRuleQueryTest { assertEquals(followPath(tree, "10"), results.get(0)); }); - assertExpression("docOrder((((/)/descendant::(element(dummyNode) | element(dummyNodeB)))/child::element(dummyNode))[(string(data(@Image))) eq 10])", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("docOrder((((/)/descendant::(element(dummyNode) | element(dummyNodeB)))/child::element(dummyNode))[(data(attribute::attribute(Image))) = 10])", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); } @Test @@ -266,7 +266,7 @@ class SaxonXPathRuleQueryTest { )); assertEquals(0, query.getRuleChainVisits().size()); - assertExpression("docOrder((((((/)/descendant::element(dummyNode))[(string(data(@Image))) eq 0]) | (((/)/descendant::element(dummyNodeB))[(string(data(@Image))) eq 1]))/child::element(dummyNode))[(string(data(@Image))) eq 10])", query.getFallbackExpr()); + assertExpression("docOrder((((((/)/descendant::element(dummyNode))[(data(attribute::attribute(Image))) = 0]) | (((/)/descendant::element(dummyNodeB))[(data(attribute::attribute(Image))) = 1]))/child::element(dummyNode))[(data(attribute::attribute(Image))) = 10])", query.getFallbackExpr()); tree.descendantsOrSelf().forEach(n -> { List results = query.evaluate(n); @@ -308,8 +308,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("self::node()[matches(convertTo_xs:string(data(@SimpleName)), a, )]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("((/)/descendant::element(Q{}dummyNode))[matches(convertTo_xs:string(data(@SimpleName)), a, )]", query.getFallbackExpr()); + assertExpression("self::node()[matches(zero-or-one(convertTo_xs:string(data(attribute::attribute(SimpleName)))), a, )]", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("((/)/descendant::element(Q{}dummyNode))[matches(zero-or-one(convertTo_xs:string(data(attribute::attribute(SimpleName)))), a, )]", query.getFallbackExpr()); } @Test @@ -320,8 +320,8 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("(self::node()[matches(convertTo_xs:string(data(@SimpleName)), a, )])/child::element(Q{}foo)", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); - assertExpression("docOrder((((/)/descendant::element(Q{}dummyNode))[matches(convertTo_xs:string(data(@SimpleName)), a, )])/child::element(Q{}foo))", query.getFallbackExpr()); + assertExpression("(self::node()[matches(zero-or-one(convertTo_xs:string(data(attribute::attribute(SimpleName)))), a, )])/child::element(Q{}foo)", query.getExpressionsForLocalNameOrDefault("dummyNode").get(0)); + assertExpression("docOrder((((/)/descendant::element(Q{}dummyNode))[matches(zero-or-one(convertTo_xs:string(data(attribute::attribute(SimpleName)))), a, )])/child::element(Q{}foo))", query.getFallbackExpr()); } @Test @@ -331,7 +331,7 @@ class SaxonXPathRuleQueryTest { assertEquals(1, ruleChainVisits.size()); assertTrue(ruleChainVisits.contains("dummyNode")); assertEquals(2, query.nodeNameToXPaths.size()); - assertExpression("let $v0 := imageIs(bar) return ((self::node()[ends-with(convertTo_xs:string(data(@Image)), foo)])[$v0])", query.nodeNameToXPaths.get("dummyNode").get(0)); + assertExpression("let $v0 := imageIs(bar) return ((self::node()[ends-with(zero-or-one(convertTo_xs:string(data(attribute::attribute(Image)))), foo)])[$v0])", query.nodeNameToXPaths.get("dummyNode").get(0)); } @Test @@ -373,7 +373,7 @@ class SaxonXPathRuleQueryTest { assertTrue(ruleChainVisits.contains("WhileStatement")); assertTrue(ruleChainVisits.contains("DoStatement")); - final String expectedSubexpression = "(self::node()/descendant::element(dummyNode))[imageIs(exactly-one(convertTo_xs:string(data(@Image))))]"; + final String expectedSubexpression = "(self::node()/descendant::element(dummyNode))[imageIs(exactly-one(convertTo_xs:string(data(attribute::attribute(Image)))))]"; assertExpression(expectedSubexpression, query.nodeNameToXPaths.get("ForStatement").get(0)); assertExpression(expectedSubexpression, query.nodeNameToXPaths.get("WhileStatement").get(0)); assertExpression(expectedSubexpression, query.nodeNameToXPaths.get("DoStatement").get(0)); From 02e7a713fa2f76f71ccb5a783a112c4bf37d3aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:17:28 -0300 Subject: [PATCH 010/121] Update Apex tree dumps with the new attributes --- .../pmd/lang/apex/ast/InnerClassLocations.txt | 14 ++++---- .../lang/apex/ast/NullCoalescingOperator.txt | 2 +- .../lang/apex/ast/SafeNavigationOperator.txt | 32 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt index 23e291e650..d75cb639d9 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt @@ -1,29 +1,29 @@ +- ApexFile[@DefiningType = "InnerClassLocations", @RealLoc = true] - +- UserClass[@DefiningType = "InnerClassLocations", @Image = "InnerClassLocations", @RealLoc = true, @SimpleName = "InnerClassLocations", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations", @Image = "InnerClassLocations", @InterfaceNames = null, @RealLoc = true, @SimpleName = "InnerClassLocations", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- UserClass[@DefiningType = "InnerClassLocations.bar1", @Image = "bar1", @RealLoc = true, @SimpleName = "bar1", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations.bar1", @Image = "bar1", @InterfaceNames = null, @RealLoc = true, @SimpleName = "bar1", @SuperClassName = ""] | +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar1", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- Method[@Arity = 0, @CanonicalName = "m", @Constructor = false, @DefiningType = "InnerClassLocations.bar1", @Image = "m", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] | +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar1", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] - +- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @InterfaceNames = null, @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Method[@Arity = 0, @CanonicalName = "m", @Constructor = false, @DefiningType = "InnerClassLocations.bar2", @Image = "m", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt index 0714250b3b..c064bf5032 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt @@ -1,5 +1,5 @@ +- ApexFile[@DefiningType = "NullCoalescingOperator", @RealLoc = true] - +- UserClass[@DefiningType = "NullCoalescingOperator", @Image = "NullCoalescingOperator", @RealLoc = true, @SimpleName = "NullCoalescingOperator", @SuperClassName = ""] + +- UserClass[@DefiningType = "NullCoalescingOperator", @Image = "NullCoalescingOperator", @InterfaceNames = null, @RealLoc = true, @SimpleName = "NullCoalescingOperator", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Method[@Arity = 2, @CanonicalName = "leftOrRight", @Constructor = false, @DefiningType = "NullCoalescingOperator", @Image = "leftOrRight", @RealLoc = true, @ReturnType = "String", @StaticInitializer = false] +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt index 1ab6ad30a7..a31ee20f8e 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt @@ -1,26 +1,26 @@ +- ApexFile[@DefiningType = "Foo", @RealLoc = true] - +- UserClass[@DefiningType = "Foo", @Image = "Foo", @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] + +- UserClass[@DefiningType = "Foo", @Image = "Foo", @InterfaceNames = null, @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Field[@DefiningType = "Foo", @Image = "x", @Name = "x", @RealLoc = true, @Type = "Integer", @Value = null] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Field[@DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @RealLoc = true, @Type = "String", @Value = null] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeName = "Integer"] + +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = null, @TypeName = "Integer"] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "x", @Name = "x", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "anIntegerField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "anObject", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "x", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] - +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeName = "String"] + +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = null, @TypeName = "String"] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "toExternalForm", @InputParametersSize = 0, @MethodName = "toExternalForm", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "user.getProfileUrl", @InputParametersSize = 0, @MethodName = "getProfileUrl", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "profileUrl", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 1, @CanonicalName = "bar1", @Constructor = false, @DefiningType = "Foo", @Image = "bar1", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -30,15 +30,15 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "b", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "c1", @InputParametersSize = 0, @MethodName = "c1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | +- CastExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "b1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a1", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 2, @CanonicalName = "bar2", @Constructor = false, @DefiningType = "Foo", @Image = "bar2", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -50,9 +50,9 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -60,9 +60,9 @@ | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -77,14 +77,14 @@ | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- VariableDeclaration[@DefiningType = "Foo", @Image = "s", @RealLoc = true, @Type = "String"] | +- VariableExpression[@DefiningType = "Foo", @Image = "BillingCity", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "Account", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "s", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- ReturnStatement[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "Name", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] +- SoqlExpression[@CanonicalQuery = "SELECT Name FROM Account WHERE Id = :tmpVar1", @DefiningType = "Foo", @Query = "SELECT Name FROM Account WHERE Id = :accId", @RealLoc = true] +- BindExpressions[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "accId", @RealLoc = true] From d7693369ab3eb69833e64d739425ed0de947cb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:51:21 -0300 Subject: [PATCH 011/121] Have the NodePrinter show collections as sequences --- .../kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt index 4d7d47fec7..608f742b21 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/test/ast/NodePrinters.kt @@ -93,6 +93,9 @@ open class BaseNodeAttributePrinter : TextTreeRenderer(true, -1) { is Enum<*> -> value.enumDeclaringClass.simpleName + "." + value.name is Class<*> -> value.canonicalName?.let { "$it.class" } is Number, is Boolean -> value.toString() + is Collection<*> -> value.joinToString(prefix = "(", postfix = ")", separator = ", ") { + "${valueToString(it)}" + } null -> "null" else -> null } From d9e146da7eb50f84db75379d20bd2b1a6f67beac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:51:42 -0300 Subject: [PATCH 012/121] Update Java parser test to show modifiers properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - no longer need to manually add the attributesโ€ฆ - โ€ฆbut the format is slightly different --- .../pmd/lang/java/JavaAttributesPrinter.java | 13 - .../sourceforge/pmd/lang/java/ast/Bug1429.txt | 16 +- .../sourceforge/pmd/lang/java/ast/Bug1530.txt | 4 +- .../pmd/lang/java/ast/EmptyStmts1.txt | 2 +- .../pmd/lang/java/ast/EmptyStmts2.txt | 2 +- .../pmd/lang/java/ast/EmptyStmts3.txt | 4 +- .../lang/java/ast/GitHubBug1780OuterClass.txt | 18 +- .../pmd/lang/java/ast/GitHubBug207.txt | 6 +- .../pmd/lang/java/ast/GitHubBug208.txt | 8 +- .../pmd/lang/java/ast/GitHubBug309.txt | 10 +- .../pmd/lang/java/ast/GitHubBug3642.txt | 6 +- .../pmd/lang/java/ast/LambdaBug1333.txt | 16 +- .../pmd/lang/java/ast/LambdaBug1470.txt | 18 +- .../pmd/lang/java/ast/LambdaBug206.txt | 4 +- .../pmd/lang/java/ast/ParserCornerCases.txt | 146 +++++------ .../pmd/lang/java/ast/ParserCornerCases17.txt | 112 ++++---- .../pmd/lang/java/ast/ParserCornerCases18.txt | 242 +++++++++--------- .../pmd/lang/java/ast/SwitchStatements.txt | 6 +- .../lang/java/ast/SwitchWithFallthrough.txt | 6 +- .../pmd/lang/java/ast/SynchronizedStmts.txt | 4 +- 20 files changed, 315 insertions(+), 328 deletions(-) diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java index 8a7466118b..9353eb5336 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java @@ -27,15 +27,6 @@ import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; */ public class JavaAttributesPrinter extends RelevantAttributePrinter { - @Override - protected void fillAttributes(@NonNull Node node, @NonNull List result) { - super.fillAttributes(node, result); - if (node instanceof ASTModifierList) { - result.add(getModifierAttr("EffectiveModifiers", ((ASTModifierList) node).getEffectiveModifiers())); - result.add(getModifierAttr("ExplicitModifiers", ((ASTModifierList) node).getExplicitModifiers())); - } - } - @Override protected boolean ignoreAttribute(@NonNull Node node, @NonNull Attribute attribute) { return super.ignoreAttribute(node, attribute) @@ -53,8 +44,4 @@ public class JavaAttributesPrinter extends RelevantAttributePrinter { // for some reason Boolean::new is called somewhere in the reflection layer return o instanceof Boolean && (Boolean) o; } - - private AttributeInfo getModifierAttr(String name, Set mods) { - return new AttributeInfo(name, mods.stream().map(JModifier::getToken).collect(Collectors.joining(", ", "{", "}"))); - } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt index 01258c40d0..608f1370dd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1429", @CanonicalName = "Bug1429", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1429", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "getAttributeTuples", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassType[@FullyQualified = false, @SimpleName = "Set"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -40,21 +40,21 @@ +- ClassType[@FullyQualified = false, @SimpleName = "Transformer"] +- ArgumentList[@Empty = true, @Size = 0] +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Bug1429$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "transform", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- Annotation[@SimpleName = "Override"] | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] +- ClassType[@FullyQualified = false, @SimpleName = "Object"] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "key"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "key", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -62,7 +62,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "value"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -73,7 +73,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "key", @Name = "key", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "result"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt index a885099348..44e828f3a0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1530", @CanonicalName = "Bug1530", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1530", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "incChild", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt index be73ae62df..1b135c3e52 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts1.txt @@ -3,5 +3,5 @@ +- EmptyDeclaration[] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "b", @ImportedSimpleName = "b", @PackageName = "", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts2.txt index 1285668cf4..69a2eca9a9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts2.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts2.txt @@ -1,6 +1,6 @@ +- CompilationUnit[@PackageName = "c"] +- PackageDeclaration[@Name = "c"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- EmptyDeclaration[] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "a", @ImportedSimpleName = "a", @PackageName = "", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "b", @ImportedSimpleName = "b", @PackageName = "", @Static = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt index eafa99ad6e..039439d9c1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/EmptyStmts3.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = "c"] +- PackageDeclaration[@Name = "c"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "a", @ImportedSimpleName = "a", @PackageName = "", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "c.Foo", @CanonicalName = "c.Foo", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "c", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassBody[@Empty = true, @Size = 0] +- EmptyDeclaration[] +- EmptyDeclaration[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt index aff30eada1..142013490b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt @@ -1,11 +1,11 @@ +- CompilationUnit[@PackageName = "com.pmd.test"] +- PackageDeclaration[@Name = "com.pmd.test"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.pmd.test.GitHubBug1780OuterClass", @CanonicalName = "com.pmd.test.GitHubBug1780OuterClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.pmd.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug1780OuterClass", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 4] +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "GitHubBug1780OuterClass", @Name = "GitHubBug1780OuterClass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -16,10 +16,10 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner Class AdapterClass", @Empty = false, @Image = "\"Inner Class AdapterClass\"", @Length = 24, @LiteralText = "\"Inner Class AdapterClass\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.pmd.test.GitHubBug1780OuterClass$InnerClass", @CanonicalName = "com.pmd.test.GitHubBug1780OuterClass.InnerClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "com.pmd.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "InnerClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "InnerClass", @Name = "InnerClass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -30,12 +30,12 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner Class Constructor", @Empty = false, @Image = "\"Inner Class Constructor\"", @Length = 23, @LiteralText = "\"Inner Class Constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.pmd.test.GitHubBug1780OuterClass$StaticInnerClass", @CanonicalName = "com.pmd.test.GitHubBug1780OuterClass.StaticInnerClass", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "com.pmd.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "StaticInnerClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "InnerClass"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "StaticInnerClass", @Name = "StaticInnerClass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = true, @Super = true, @This = false] @@ -51,11 +51,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "StaticInnerClass Constructor", @Empty = false, @Image = "\"StaticInnerClass Constructor\"", @Length = 28, @LiteralText = "\"StaticInnerClass Constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ArrayDimensions[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt index 003832ccac..ca175c431d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt @@ -1,15 +1,15 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug207", @CanonicalName = "GitHubBug207", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug207", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "resourceHttpMessageWriter", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] +- ClassType[@FullyQualified = false, @SimpleName = "HttpMessageWriter"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Resource"] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = true, @SimpleName = "Context"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "context", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt index 8f6325ca3f..0f682c9800 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt @@ -1,22 +1,22 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug208", @CanonicalName = "GitHubBug208", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug208", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalClassStatement[] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug208$1LocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Lazy"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Lazy"] | +- Annotation[@SimpleName = "Configuration"] | +- ClassType[@FullyQualified = false, @SimpleName = "Configuration"] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Bean"] | +- ClassType[@FullyQualified = false, @SimpleName = "Bean"] +- ClassType[@FullyQualified = false, @SimpleName = "Object"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt index 6daf50aaa1..83f0187049 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt @@ -1,14 +1,14 @@ +- CompilationUnit[@PackageName = ""] +- ImportDeclaration[@ImportOnDemand = true, @ImportedName = "java.util", @ImportedSimpleName = null, @PackageName = "java.util", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug309", @CanonicalName = "GitHubBug309", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug309", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -16,7 +16,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | +- VariableDeclarator[@Initializer = true, @Name = "r11"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -26,7 +26,7 @@ | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "IntFunction"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ArrayType[@ArrayDepth = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt index df2fdaa8b0..7dd84d21a6 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt @@ -1,12 +1,12 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug3642", @CanonicalName = "GitHubBug3642", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GitHubBug3642", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "GitHubBug3642$Foo", @CanonicalName = "GitHubBug3642.Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Foo", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] +- AnnotationTypeBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "v1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- FormalParameters[@Empty = true, @Size = 0] +- ArrayDimensions[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt index 1a79f6503f..8ed63303b7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Bug1333", @CanonicalName = "Bug1333", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Bug1333", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] +- ClassBody[@Empty = false, @Size = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "Logger"] | +- VariableDeclarator[@Initializer = true, @Name = "LOG"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LOG", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] @@ -13,7 +13,7 @@ | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Foo"] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "deleteDirectoriesByNamePattern", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -23,17 +23,17 @@ | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- MethodCall[@CompileTimeConstant = false, @Image = "deleteDirectory", @MethodName = "deleteDirectory", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "path", @Name = "path", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "delete", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Consumer"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = true, @UpperBound = false] @@ -48,11 +48,11 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "consumer", @Name = "consumer", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "deleteDirectory", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt index 45a2db1cc1..087f538552 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt @@ -1,18 +1,18 @@ +- CompilationUnit[@PackageName = "com.sample.test"] +- PackageDeclaration[@Name = "com.sample.test"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "rx.Observable", @ImportedSimpleName = "Observable", @PackageName = "rx", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "rx.Subscriber", @ImportedSimpleName = "Subscriber", @PackageName = "rx", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.sample.test.pmdTest", @CanonicalName = "com.sample.test.pmdTest", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.sample.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "pmdTest", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | +- VariableDeclarator[@Initializer = false, @Name = "stuff"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "stuff", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Boolean"] @@ -27,7 +27,7 @@ | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Subscriber"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- WildcardType[@LowerBound = true, @UpperBound = false] @@ -42,11 +42,11 @@ | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Boolean"] @@ -61,7 +61,7 @@ | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -72,6 +72,6 @@ +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt index 8a98bbff93..4d2966d6cd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = ""] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.PUBLIC)] +- AnnotationTypeBody[@Empty = false, @Size = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Static = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{static, final}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] +- ClassType[@FullyQualified = false, @SimpleName = "ThreadLocal"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Interner"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt index 9d337871f6..8860f0dbb2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt @@ -1,41 +1,41 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Superclass", @CanonicalName = "Superclass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Superclass", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 3] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Superclass", @Name = "Superclass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Superclass", @Name = "Superclass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "V", @Name = "V", @TypeBound = false] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "clazz", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "doStuff", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Outer", @CanonicalName = "Outer", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Outer", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 2] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Outer", @Name = "Outer", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] @@ -46,10 +46,10 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Outer constructor", @Empty = false, @Image = "\"Outer constructor\"", @Length = 17, @LiteralText = "\"Outer constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Outer$Inner", @CanonicalName = "Outer.Inner", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Inner", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Inner", @Name = "Inner", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -60,16 +60,16 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner constructor", @Empty = false, @Image = "\"Inner constructor\"", @Length = 17, @LiteralText = "\"Inner constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Child", @CanonicalName = "Child", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Child", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Inner"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Outer"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Child", @Name = "Child", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Outer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -84,21 +84,21 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Child constructor", @Empty = false, @Image = "\"Child constructor\"", @Length = 17, @LiteralText = "\"Child constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases", @CanonicalName = "ParserCornerCases", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Superclass"] | +- ClassBody[@Empty = false, @Size = 8] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -109,16 +109,16 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "W", @Name = "W", @TypeBound = false] | | +- FormalParameters[@Empty = false, @Size = 2] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -129,22 +129,22 @@ | | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | | +- ArgumentList[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testGeneric", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public, strictfp}", @ExplicitModifiers = "{public, strictfp}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STRICTFP), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STRICTFP)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -155,7 +155,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "foo", @Empty = false, @Image = "\"foo\"", @Length = 3, @LiteralText = "\"foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "v"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "v", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -166,20 +166,20 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "bar", @Empty = false, @Image = "\"bar\"", @Length = 3, @LiteralText = "\"bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "thisGeneric", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getByteArrayClass", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -190,7 +190,7 @@ | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "bitwiseOperator", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -208,23 +208,23 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "shift ", @Empty = false, @Image = "\"shift \"", @Length = 6, @LiteralText = "\"shift \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PmdTestParent", @CanonicalName = "PmdTestParent", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdTestParent", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "PmdTestParent", @Name = "PmdTestParent", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PmdTestChild", @CanonicalName = "PmdTestChild", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdTestChild", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "PmdTestParent"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "PmdTestChild", @Name = "PmdTestChild", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] @@ -233,15 +233,15 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "PmdTestChild$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "create", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "memoryMonitor"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "memoryMonitor", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -260,26 +260,26 @@ | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "memoryMonitor", @Name = "memoryMonitor", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBean", @CanonicalName = "SimpleBean", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBean", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = false, @Name = "name"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser", @CanonicalName = "SimpleBeanUser", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 2] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser", @Name = "SimpleBeanUser", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser", @Name = "SimpleBeanUser", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = false, @This = true] @@ -288,7 +288,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- Initializer[@Static = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -297,12 +297,12 @@ | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser2", @CanonicalName = "SimpleBeanUser2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser2", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBeanUser"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser2", @Name = "SimpleBeanUser2", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] @@ -311,7 +311,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser2$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- Initializer[@Static = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -320,17 +320,17 @@ | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test2", @Empty = false, @Image = "\"test2\"", @Length = 5, @LiteralText = "\"test2\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "TestParseAnnototation", @CanonicalName = "TestParseAnnototation", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "TestParseAnnototation", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "parse", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- ForStatement[] | | +- ForInit[] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "SuppressWarnings"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -351,7 +351,7 @@ | +- ForStatement[] | | +- ForInit[] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "SuppressWarnings"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -370,7 +370,7 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -383,7 +383,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- ForeachStatement[] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "SuppressWarnings"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] | | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -395,26 +395,26 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "FooBlock", @CanonicalName = "FooBlock", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "FooBlock", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "MyFoo", @CanonicalName = "MyFoo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyFoo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "MyFoo", @Name = "MyFoo", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "FooBlock"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyFoo"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Foo", @Name = "Foo", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] @@ -423,19 +423,19 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "FooBlock"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Foo$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "valueOf", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "object", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fish"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fish", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -443,10 +443,10 @@ | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fish", @Name = "fish", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SuperTest", @CanonicalName = "SuperTest", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SuperTest", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "iterator", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] @@ -467,10 +467,10 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] | | +- ArgumentList[@Empty = true, @Size = 0] | | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SuperTest$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassBody[@Empty = false, @Size = 4] | | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_ANONYMOUS, @Static = false, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] @@ -481,7 +481,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ImmutableSet"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "hasNext", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -491,7 +491,7 @@ | | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "next", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -501,7 +501,7 @@ | | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "remove", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -528,15 +528,15 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "UnsupportedOperationException"] | +- ArgumentList[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ClazzPropertyOfPrimitiveTypes", @CanonicalName = "ClazzPropertyOfPrimitiveTypes", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ClazzPropertyOfPrimitiveTypes", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 11, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- WildcardType[@LowerBound = false, @UpperBound = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt index da23efe42b..5f7cfe059b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt @@ -11,21 +11,21 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Map", @ImportedSimpleName = "Map", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.zip.ZipEntry", @ImportedSimpleName = "ZipEntry", @PackageName = "java.util.zip", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases17", @CanonicalName = "ParserCornerCases17", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases17", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 9] +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases17", @Name = "ParserCornerCases17", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "binaryLiterals", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 9, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- VariableDeclarator[@Initializer = true, @Name = "aByte"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aByte", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -33,7 +33,7 @@ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00100001", @IntLiteral = true, @Integral = true, @LiteralText = "0b00100001", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 33.0, @ValueAsFloat = 33.0, @ValueAsInt = 33, @ValueAsLong = 33] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.SHORT] | | +- VariableDeclarator[@Initializer = true, @Name = "aShort"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aShort", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -41,31 +41,31 @@ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.SHORT] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b1010000101000101", @IntLiteral = true, @Integral = true, @LiteralText = "0b1010000101000101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 41285.0, @ValueAsFloat = 41285.0, @ValueAsInt = 41285, @ValueAsLong = 41285] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000100000000010100001010001", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000100000000010100001010001", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8398929.0, @ValueAsFloat = 8398929.0, @ValueAsInt = 8398929, @ValueAsLong = 8398929] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b101", @IntLiteral = true, @Integral = true, @LiteralText = "0b101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt3"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0B101", @IntLiteral = true, @Integral = true, @LiteralText = "0B101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "aLong"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b0000000000000000000000000000000000000000100010001000010000010000L", @IntLiteral = false, @Integral = true, @LiteralText = "0b0000000000000000000000000000000000000000100010001000010000010000L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8946704.0, @ValueAsFloat = 8946704.0, @ValueAsInt = 8946704, @ValueAsLong = 8946704] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -82,7 +82,7 @@ | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01001100", @IntLiteral = true, @Integral = true, @LiteralText = "0b01001100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 76.0, @ValueAsFloat = 76.0, @ValueAsInt = 76, @ValueAsLong = 76] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b10011000", @IntLiteral = true, @Integral = true, @LiteralText = "0b10011000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 152.0, @ValueAsFloat = 152.0, @ValueAsInt = 152, @ValueAsLong = 152] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "instruction"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "instruction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -95,7 +95,7 @@ | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "register"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "register", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -145,113 +145,113 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "underscoreInNumericLiterals", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 15, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "creditCardNumber"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "creditCardNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1111_2222_3333_4444L", @IntLiteral = false, @Integral = true, @LiteralText = "1111_2222_3333_4444L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.111222233334444E15, @ValueAsFloat = 1.11122226E15, @ValueAsInt = -1770257748, @ValueAsLong = 1111222233334444] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "socialSecurityNumber"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "socialSecurityNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "999_99_9999L", @IntLiteral = false, @Integral = true, @LiteralText = "999_99_9999L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.99999999E8, @ValueAsFloat = 1.0E9, @ValueAsInt = 999999999, @ValueAsLong = 999999999] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.FLOAT] | | +- VariableDeclarator[@Initializer = true, @Name = "pi"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = true, @Image = "3.14_15F", @IntLiteral = false, @Integral = false, @LiteralText = "3.14_15F", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.1415, @ValueAsFloat = 3.1415, @ValueAsInt = 3, @ValueAsLong = 3] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "hexBytes"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexBytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x00_11_22_33", @IntLiteral = true, @Integral = true, @LiteralText = "0x00_11_22_33", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1122867.0, @ValueAsFloat = 1122867.0, @ValueAsInt = 1122867, @ValueAsLong = 1122867] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "hexWords"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexWords", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x0001_CAFE", @IntLiteral = true, @Integral = true, @LiteralText = "0x0001_CAFE", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 117502.0, @ValueAsFloat = 117502.0, @ValueAsInt = 117502, @ValueAsLong = 117502] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "maxLong"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "maxLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x7fff_ffff_ffff_ffffL", @IntLiteral = false, @Integral = true, @LiteralText = "0x7fff_ffff_ffff_ffffL", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.223372036854776E18, @ValueAsFloat = 9.223372E18, @ValueAsInt = -1, @ValueAsLong = 9223372036854775807] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- VariableDeclarator[@Initializer = true, @Name = "nybbles"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "nybbles", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b0010_0101", @IntLiteral = true, @Integral = true, @LiteralText = "0b0010_0101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 37.0, @ValueAsFloat = 37.0, @ValueAsInt = 37, @ValueAsLong = 37] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "bytes"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000_10001000_10000100_00010000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000_10001000_10000100_00010000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8946704.0, @ValueAsFloat = 8946704.0, @ValueAsInt = 8946704, @ValueAsLong = 8946704] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "_52"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_52", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "_52", @Name = "_52", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5_2", @IntLiteral = true, @Integral = true, @LiteralText = "5_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 52.0, @ValueAsFloat = 52.0, @ValueAsInt = 52, @ValueAsLong = 52] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x4"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5_______2", @IntLiteral = true, @Integral = true, @LiteralText = "5_______2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 52.0, @ValueAsFloat = 52.0, @ValueAsInt = 52, @ValueAsLong = 52] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x7"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x7", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x5_2", @IntLiteral = true, @Integral = true, @LiteralText = "0x5_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 82.0, @ValueAsFloat = 82.0, @ValueAsInt = 82, @ValueAsLong = 82] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x9"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x9", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 8, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0_52", @IntLiteral = true, @Integral = true, @LiteralText = "0_52", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "x10"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x10", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 8, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "05_2", @IntLiteral = true, @Integral = true, @LiteralText = "05_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "stringsInSwitchStatements", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "dayOfWeekArg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "dayOfWeekArg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Wednesday", @Empty = false, @Image = "\"Wednesday\"", @Length = 9, @LiteralText = "\"Wednesday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = false, @Name = "typeOfDay"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "typeOfDay", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -310,27 +310,27 @@ | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "typeOfDay", @Name = "typeOfDay", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases17$MyClass", @CanonicalName = "ParserCornerCases17.MyClass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "MyClass", @Name = "MyClass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "typeInferenceForGenericInstanceCreation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 6, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Map"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -344,7 +344,7 @@ | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -360,7 +360,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -377,7 +377,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "list2", @Name = "list2", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "MyClass"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -389,14 +389,14 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"", @Length = 0, @LiteralText = "\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "theTryWithResourcesStatement", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- ThrowsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "path"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -405,7 +405,7 @@ | | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] | | | +- Resource[@ConciseResource = false, @StableName = "br"] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "BufferedReader"] | | | +- VariableDeclarator[@Initializer = true, @Name = "br"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "br", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -418,7 +418,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "path", @Name = "path", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "first"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "first", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -426,19 +426,19 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "br", @Name = "br", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFileName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo-out", @Empty = false, @Image = "\"/foo-out\"", @Length = 8, @LiteralText = "\"/foo-out\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipFileName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo.zip", @Empty = false, @Image = "\"/foo.zip\"", @Length = 8, @LiteralText = "\"/foo.zip\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "Charset"] | | +- VariableDeclarator[@Initializer = true, @Name = "charset"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "charset", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -448,7 +448,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "US-ASCII", @Empty = false, @Image = "\"US-ASCII\"", @Length = 8, @LiteralText = "\"US-ASCII\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "Path"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFilePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFilePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -461,7 +461,7 @@ | +- ResourceList[@Empty = false, @Size = 2, @TrailingSemiColon = false] | | +- Resource[@ConciseResource = false, @StableName = "zf"] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipFile"] | | | +- VariableDeclarator[@Initializer = true, @Name = "zf"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zf", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -471,7 +471,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zipFileName", @Name = "zipFileName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Resource[@ConciseResource = false, @StableName = "writer"] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "BufferedWriter"] | | +- VariableDeclarator[@Initializer = true, @Name = "writer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "writer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -485,7 +485,7 @@ | +- ForStatement[] | +- ForInit[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Enumeration"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -500,7 +500,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "newLine"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "newLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -510,7 +510,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "line.separator", @Empty = false, @Image = "\"line.separator\"", @Length = 14, @LiteralText = "\"line.separator\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipEntryName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipEntryName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -533,7 +533,7 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zipEntryName", @Name = "zipEntryName", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "catchingMultipleExceptionTypes", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- ThrowsList[@Empty = false, @Size = 2] @@ -556,7 +556,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = true, @Name = "ex", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- UnionType[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "SQLException"] @@ -569,12 +569,12 @@ | +- ThrowStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "ex", @Name = "ex", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "expressionInCastExpression", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- VariableDeclarator[@Initializer = true, @Name = "initialSizeGlobal"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt index ea7fbaf5dd..5def9e475a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt @@ -10,22 +10,22 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.function.Supplier", @ImportedSimpleName = "Supplier", @PackageName = "java.util.function", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Stream", @ImportedSimpleName = "Stream", @PackageName = "java.util.stream", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18", @CanonicalName = "ParserCornerCases18", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases18", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassBody[@Empty = false, @Size = 30] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lambdas", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 24, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] @@ -35,14 +35,14 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -51,14 +51,14 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java3"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -67,14 +67,14 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java4"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -96,7 +96,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -109,7 +109,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -125,7 +125,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -133,7 +133,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -141,7 +141,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "startsWith", @MethodName = "startsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -161,7 +161,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -169,7 +169,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -177,7 +177,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "startsWith", @MethodName = "startsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -186,7 +186,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "q", @Empty = false, @Image = "\"q\"", @Length = 1, @LiteralText = "\"q\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -200,7 +200,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "user.name", @Empty = false, @Image = "\"user.name\"", @Length = 9, @LiteralText = "\"user.name\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Callable"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -210,7 +210,7 @@ | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -225,7 +225,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Supplier"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] @@ -244,7 +244,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hi", @Empty = false, @Image = "\"hi\"", @Length = 2, @LiteralText = "\"hi\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | | | +- VariableDeclarator[@Initializer = true, @Name = "flag"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "flag", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -252,7 +252,7 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Callable"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -267,7 +267,7 @@ | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -291,7 +291,7 @@ | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparator"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -300,10 +300,10 @@ | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareToIgnoreCase", @MethodName = "compareToIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s1", @Name = "s1", @ParenthesisDepth = 0, @Parenthesized = false] @@ -315,17 +315,17 @@ | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareToIgnoreCase", @MethodName = "compareToIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s1", @Name = "s1", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s2", @Name = "s2", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Button"] | | | +- VariableDeclarator[@Initializer = true, @Name = "button"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "button", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -339,7 +339,7 @@ | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -350,7 +350,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "initialSizeGlobal"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -364,7 +364,7 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "150.0", @IntLiteral = false, @Integral = false, @LiteralText = "150.0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 150.0, @ValueAsFloat = 150.0, @ValueAsInt = 150, @ValueAsLong = 150] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "0.30", @IntLiteral = false, @Integral = false, @LiteralText = "0.30", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.3, @ValueAsFloat = 0.3, @ValueAsInt = 0, @ValueAsLong = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "BiConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -374,11 +374,11 @@ | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -386,7 +386,7 @@ | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "BiConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -396,17 +396,17 @@ | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "TriConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 3] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -417,15 +417,15 @@ | | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -434,7 +434,7 @@ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "TriConsumer"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 3] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -445,13 +445,13 @@ | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] @@ -459,7 +459,7 @@ | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$TriConsumer", @CanonicalName = "ParserCornerCases18.TriConsumer", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "TriConsumer", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "FunctionalInterface"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FunctionalInterface"] | | +- TypeParameters[@Empty = false, @Size = 3] @@ -468,23 +468,23 @@ | | | +- TypeParameter[@Image = "C", @Name = "C", @TypeBound = false] | | +- ClassBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = true, @Arity = 3, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "accept", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 3] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] @@ -499,7 +499,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "toDoLater", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -515,11 +515,11 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "later", @Empty = false, @Image = "\"later\"", @Length = 5, @LiteralText = "\"later\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "doPrivileged", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "PrivilegedAction"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -530,11 +530,11 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "action", @Name = "action", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "filterFiles", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -542,7 +542,7 @@ | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "comparingByKey", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 2] | | | +- TypeParameter[@Image = "K", @Name = "K", @TypeBound = true] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparable"] @@ -571,10 +571,10 @@ | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareTo", @MethodName = "compareTo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getKey", @MethodName = "getKey", @ParenthesisDepth = 0, @Parenthesized = false] @@ -585,12 +585,12 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c2", @Name = "c2", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodReferences", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 8, @containsComment = true] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -599,14 +599,14 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- VariableDeclarator[@Initializer = true, @Name = "pc"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pc", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -614,14 +614,14 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r11"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pc", @Name = "pc", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Supplier"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -630,7 +630,7 @@ | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -638,7 +638,7 @@ | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "IntFunction"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ArrayType[@ArrayDepth = 1] @@ -654,7 +654,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -666,10 +666,10 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$PmdMethodReferenceTest", @CanonicalName = "ParserCornerCases18.PmdMethodReferenceTest", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdMethodReferenceTest", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- ClassBody[@Empty = false, @Size = 3] | | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Function"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -677,7 +677,7 @@ | | | +- VariableDeclarator[@Initializer = false, @Name = "theFunction"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "theFunction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "PmdTest", @Name = "PmdTest", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -686,18 +686,18 @@ | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "foo", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "staticMethod", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -711,12 +711,12 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "run", @Empty = false, @Image = "\"run\"", @Length = 3, @LiteralText = "\"run\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "typeAnnotations", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "myString"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -726,7 +726,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "str", @Name = "str", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -736,7 +736,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Interned"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$UnmodifiableList", @CanonicalName = "ParserCornerCases18.UnmodifiableList", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "UnmodifiableList", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | | +- ImplementsList[@Empty = false, @Size = 1] @@ -749,7 +749,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Readonly"] | | +- ClassBody[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "monitorTemperature", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- ThrowsList[@Empty = false, @Size = 1] @@ -758,10 +758,10 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Critical"] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$X", @CanonicalName = "ParserCornerCases18.X", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "X", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- ClassBody[@Empty = false, @Size = 3] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lambaWithIf", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- VoidType[] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -779,14 +779,14 @@ | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -812,7 +812,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lambaWithIf2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- VoidType[] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -830,16 +830,16 @@ | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -865,7 +865,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lambdaWithPropertyAssignment", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -877,7 +877,7 @@ | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 2, @containsComment = true] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | | +- VariableDeclarator[@Initializer = true, @Name = "request"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "request", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -890,7 +890,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "request", @Name = "request", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testWildCardWithAnnotation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -901,7 +901,7 @@ | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testAnnotationsToArrayElements", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -913,7 +913,7 @@ | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "getBytes", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -925,7 +925,7 @@ | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "getEnum", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Enum"] @@ -939,7 +939,7 @@ | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "getNullableEnum", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] @@ -950,7 +950,7 @@ | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "createNonNullArray", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -967,7 +967,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "check", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | | +- ArrayType[@ArrayDepth = 2] @@ -977,7 +977,7 @@ | | | +- ArrayTypeDim[@Varargs = false] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 2] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | | | +- ArrayDimensions[@Empty = false, @Size = 2] @@ -1001,7 +1001,7 @@ | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "arr", @Name = "arr", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "func", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ClassType[@FullyQualified = false, @SimpleName = "Function"] | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- ReceiverParameter[] @@ -1015,11 +1015,11 @@ | | +- Annotation[@SimpleName = "A"] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "max", @Overridden = false, @Static = true, @Varargs = true, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Varargs = true, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -1031,7 +1031,7 @@ | | +- ReturnStatement[] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "ParserCornerCases18$Anno", @CanonicalName = "ParserCornerCases18.Anno", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Anno", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Retention"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Retention"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -1046,12 +1046,12 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TYPE_USE", @Name = "TYPE_USE", @ParenthesisDepth = 0, @Parenthesized = false] | | +- AnnotationTypeBody[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "testMultiDimArrayWithAnnotations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -1072,25 +1072,25 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverParameter", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- ReceiverParameter[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverAndOtherParameters", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- ReceiverParameter[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverParameterWithAnnotation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- ReceiverParameter[] @@ -1098,12 +1098,12 @@ | | | | +- Annotation[@SimpleName = "AnnotatedUsage"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "AnnotatedUsage"] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "ParserCornerCases18$AnnotatedUsage", @CanonicalName = "ParserCornerCases18.AnnotatedUsage", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "AnnotatedUsage", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Target"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] | | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -1112,37 +1112,37 @@ | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ElementType", @Name = "ElementType", @ParenthesisDepth = 0, @Parenthesized = false] | | +- AnnotationTypeBody[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$Inner", @CanonicalName = "ParserCornerCases18.Inner", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Inner", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Inner", @Name = "Inner", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = true, @Size = 0] | | +- ReceiverParameter[] | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "DefaultIterator", @CanonicalName = "DefaultIterator", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "DefaultIterator", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{abstract}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT), @ExplicitModifiers = ()] +- TypeParameters[@Empty = false, @Size = 1] | +- TypeParameter[@Image = "E", @Name = "E", @TypeBound = false] +- ClassBody[@Empty = false, @Size = 5] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "hasNext", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | +- FormalParameters[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "next", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "E"] | +- FormalParameters[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "remove", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "skip", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, default}", @ExplicitModifiers = "{default}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.DEFAULT), @ExplicitModifiers = (JModifier.DEFAULT)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -1161,7 +1161,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "next", @MethodName = "next", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "staticInterfaceMethods", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt index 81526b0f54..1ee0d5297d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt @@ -1,14 +1,14 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchStatements", @CanonicalName = "SwitchStatements", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchStatements", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "myMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 4, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "a"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt index 8bbb9b14a6..610f877edb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt @@ -1,14 +1,14 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchWithFallthrough", @CanonicalName = "SwitchWithFallthrough", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchWithFallthrough", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "myMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "a"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt index 0c35bbbbb2..557f881ed2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SynchronizedStmts.txt @@ -1,9 +1,9 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Sync", @CanonicalName = "Sync", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sync", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getInstance", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] From ca7e15c114f3b4143ad678bdafa9d18c46bb8e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 01:55:54 -0300 Subject: [PATCH 013/121] update output to sequences --- .../pmd/lang/apex/ast/InnerClassLocations.txt | 14 ++++---- .../lang/apex/ast/NullCoalescingOperator.txt | 2 +- .../lang/apex/ast/SafeNavigationOperator.txt | 32 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt index d75cb639d9..095e8b8803 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt @@ -1,29 +1,29 @@ +- ApexFile[@DefiningType = "InnerClassLocations", @RealLoc = true] - +- UserClass[@DefiningType = "InnerClassLocations", @Image = "InnerClassLocations", @InterfaceNames = null, @RealLoc = true, @SimpleName = "InnerClassLocations", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations", @Image = "InnerClassLocations", @InterfaceNames = (), @RealLoc = true, @SimpleName = "InnerClassLocations", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- UserClass[@DefiningType = "InnerClassLocations.bar1", @Image = "bar1", @InterfaceNames = null, @RealLoc = true, @SimpleName = "bar1", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations.bar1", @Image = "bar1", @InterfaceNames = (), @RealLoc = true, @SimpleName = "bar1", @SuperClassName = ""] | +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar1", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- Method[@Arity = 0, @CanonicalName = "m", @Constructor = false, @DefiningType = "InnerClassLocations.bar1", @Image = "m", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] | +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar1", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] - +- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @InterfaceNames = null, @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""] + +- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @InterfaceNames = (), @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Method[@Arity = 0, @CanonicalName = "m", @Constructor = false, @DefiningType = "InnerClassLocations.bar2", @Image = "m", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt index c064bf5032..2d0eca99ed 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/NullCoalescingOperator.txt @@ -1,5 +1,5 @@ +- ApexFile[@DefiningType = "NullCoalescingOperator", @RealLoc = true] - +- UserClass[@DefiningType = "NullCoalescingOperator", @Image = "NullCoalescingOperator", @InterfaceNames = null, @RealLoc = true, @SimpleName = "NullCoalescingOperator", @SuperClassName = ""] + +- UserClass[@DefiningType = "NullCoalescingOperator", @Image = "NullCoalescingOperator", @InterfaceNames = (), @RealLoc = true, @SimpleName = "NullCoalescingOperator", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Method[@Arity = 2, @CanonicalName = "leftOrRight", @Constructor = false, @DefiningType = "NullCoalescingOperator", @Image = "leftOrRight", @RealLoc = true, @ReturnType = "String", @StaticInitializer = false] +- ModifierNode[@Abstract = false, @DefiningType = "NullCoalescingOperator", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt index a31ee20f8e..226b07f37a 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt @@ -1,26 +1,26 @@ +- ApexFile[@DefiningType = "Foo", @RealLoc = true] - +- UserClass[@DefiningType = "Foo", @Image = "Foo", @InterfaceNames = null, @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] + +- UserClass[@DefiningType = "Foo", @Image = "Foo", @InterfaceNames = (), @RealLoc = true, @SimpleName = "Foo", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Field[@DefiningType = "Foo", @Image = "x", @Name = "x", @RealLoc = true, @Type = "Integer", @Value = null] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] +- Field[@DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @RealLoc = true, @Type = "String", @Value = null] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] - +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = null, @TypeName = "Integer"] + +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = (), @TypeName = "Integer"] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "x", @Name = "x", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "anIntegerField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "anObject", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "x", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] - +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = null, @TypeName = "String"] + +- FieldDeclarationStatements[@DefiningType = "Foo", @RealLoc = true, @TypeArguments = (), @TypeName = "String"] | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "toExternalForm", @InputParametersSize = 0, @MethodName = "toExternalForm", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "user.getProfileUrl", @InputParametersSize = 0, @MethodName = "getProfileUrl", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @Names = ("user"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "profileUrl", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 1, @CanonicalName = "bar1", @Constructor = false, @DefiningType = "Foo", @Image = "bar1", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -30,15 +30,15 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "b", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "c1", @InputParametersSize = 0, @MethodName = "c1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | +- CastExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "b1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a1", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 2, @CanonicalName = "bar2", @Constructor = false, @DefiningType = "Foo", @Image = "bar2", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -50,9 +50,9 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -60,9 +60,9 @@ | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -77,14 +77,14 @@ | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- VariableDeclaration[@DefiningType = "Foo", @Image = "s", @RealLoc = true, @Type = "String"] | +- VariableExpression[@DefiningType = "Foo", @Image = "BillingCity", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "Account", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @Names = null, @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @Names = ("contact"), @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "s", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- ReturnStatement[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "Name", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = null, @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] +- SoqlExpression[@CanonicalQuery = "SELECT Name FROM Account WHERE Id = :tmpVar1", @DefiningType = "Foo", @Query = "SELECT Name FROM Account WHERE Id = :accId", @RealLoc = true] +- BindExpressions[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "accId", @RealLoc = true] From 0d32ac8aa1196ad602c9aab44760c3ba289316fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 02:02:49 -0300 Subject: [PATCH 014/121] Update more tree dump tests --- .../java14/MultipleCaseLabels.txt | 22 +-- .../java14/SimpleSwitchExpressions.txt | 32 ++-- .../java14/SwitchExpressions.txt | 50 +++---- .../jdkversiontests/java14/SwitchRules.txt | 22 +-- .../java14/YieldStatements.txt | 4 +- .../java15/NonSealedIdentifier.txt | 12 +- .../ast/jdkversiontests/java15/TextBlocks.txt | 42 +++--- .../LocalClassAndInterfaceDeclarations.txt | 16 +- .../jdkversiontests/java16/LocalRecords.txt | 58 ++++---- .../java16/NonSealedIdentifier.txt | 12 +- .../java16/PatternMatchingInstanceof.txt | 34 ++--- .../java/ast/jdkversiontests/java16/Point.txt | 12 +- .../ast/jdkversiontests/java16/Records.txt | 70 ++++----- .../ast/jdkversiontests/java17/LocalVars.txt | 6 +- .../java17/SealedInnerClasses.txt | 10 +- .../java17/expression/Expr.txt | 4 +- .../jdkversiontests/java17/geometry/Shape.txt | 4 +- .../java17/geometry/Square.txt | 4 +- .../java21/AnnotationValueInitializers.txt | 4 +- .../java21/DealingWithNull.txt | 40 ++--- .../java21/EnhancedTypeCheckingSwitch.txt | 34 ++--- .../java21/ExhaustiveSwitch.txt | 62 ++++---- .../java21/GuardedPatterns.txt | 54 +++---- .../java21/Jep440_RecordPatterns.txt | 102 ++++++------- .../Jep441_PatternMatchingForSwitch.txt | 88 +++++------ .../java21/PatternsInSwitchLabels.txt | 18 +-- .../jdkversiontests/java21/RecordPatterns.txt | 140 +++++++++--------- .../java21/RecordPatternsExhaustiveSwitch.txt | 56 +++---- .../java21/RefiningPatternsInSwitch.txt | 46 +++--- .../ScopeOfPatternVariableDeclarations.txt | 28 ++-- .../java21p/Jep430_StringTemplates.txt | 124 ++++++++-------- .../Jep443_UnnamedPatternsAndVariables.txt | 130 ++++++++-------- .../java21p/Jep445_UnnamedClasses1.txt | 2 +- .../java21p/Jep445_UnnamedClasses2.txt | 4 +- .../java21p/Jep445_UnnamedClasses3.txt | 4 +- .../Jep456_UnnamedPatternsAndVariables.txt | 130 ++++++++-------- .../java22p/Jep447_StatementsBeforeSuper.txt | 76 +++++----- .../java22p/Jep459_StringTemplates.txt | 124 ++++++++-------- .../java22p/Jep463_UnnamedClasses1.txt | 2 +- .../java22p/Jep463_UnnamedClasses2.txt | 4 +- .../java22p/Jep463_UnnamedClasses3.txt | 4 +- .../Jep463_UnnamedClasses4WithImports.txt | 4 +- 42 files changed, 847 insertions(+), 847 deletions(-) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt index 4018308d53..918c051e17 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt @@ -1,55 +1,55 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "MultipleCaseLabels", @CanonicalName = "MultipleCaseLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MultipleCaseLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 8] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -57,7 +57,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "day"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt index cc10dae8d4..e60528906c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt @@ -1,55 +1,55 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleSwitchExpressions", @CanonicalName = "SimpleSwitchExpressions", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleSwitchExpressions", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 9] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -57,13 +57,13 @@ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "day"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "numLetters"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -91,7 +91,7 @@ | | +- SwitchLabel[@Default = true] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "k"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -99,7 +99,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "result"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -117,11 +117,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NumLetters: %d%n", @Empty = false, @Image = "\"NumLetters: %d%n\"", @Length = 16, @LiteralText = "\"NumLetters: %d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "numLetters", @Name = "numLetters", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "f", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt index 43c635bcd7..408ae2734d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt @@ -1,43 +1,43 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchExpressions", @CanonicalName = "SwitchExpressions", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchExpressions", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 6] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchExpressions$Day", @CanonicalName = "SwitchExpressions.Day", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Day", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE)] | +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 7, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "MONDAY", @MethodName = "new", @Name = "MONDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "TUESDAY", @MethodName = "new", @Name = "TUESDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "WEDNESDAY", @MethodName = "new", @Name = "WEDNESDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "THURSDAY", @MethodName = "new", @Name = "THURSDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "FRIDAY", @MethodName = "new", @Name = "FRIDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "SATURDAY", @MethodName = "new", @Name = "SATURDAY", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "SUNDAY", @MethodName = "new", @Name = "SUNDAY", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Static = true, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "BAZ"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BAZ", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PUBLIC] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -45,7 +45,7 @@ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 15, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Day"] | | +- VariableDeclarator[@Initializer = true, @Name = "day"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -94,7 +94,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "numLetters"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -152,7 +152,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "j"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "j", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -170,7 +170,7 @@ | | +- SwitchLabel[@Default = true] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "k"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -180,7 +180,7 @@ | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "result"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -198,13 +198,13 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "j=%d%n", @Empty = false, @Image = "\"j=%d%n\"", @Length = 6, @LiteralText = "\"j=%d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "j", @Name = "j", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "result"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -247,11 +247,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "result=%d%n", @Empty = false, @Image = "\"result=%d%n\"", @Length = 11, @LiteralText = "\"result=%d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "result", @Name = "result", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "howMany", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -284,11 +284,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "many", @Empty = false, @Image = "\"many\"", @Length = 4, @LiteralText = "\"many\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "howManyExpr", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -312,11 +312,11 @@ | +- SwitchLabel[@Default = true] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "many", @Empty = false, @Image = "\"many\"", @Length = 4, @LiteralText = "\"many\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "f", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt index 6c25858d7a..f14d4f4dbd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt @@ -1,55 +1,55 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SwitchRules", @CanonicalName = "SwitchRules", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SwitchRules", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 8] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -57,7 +57,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "day"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt index 6d34dc9515..e054f1877b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt @@ -1,11 +1,11 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "YieldStatements", @CanonicalName = "YieldStatements", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "YieldStatements", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- Initializer[@Static = false] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "yield"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "yield", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt index 1abb1176b2..260983fffe 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "NonSealedIdentifier", @CanonicalName = "NonSealedIdentifier", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NonSealedIdentifier", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -15,19 +15,19 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt index 82ad86c833..d1c329260a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt @@ -2,14 +2,14 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "javax.script.ScriptEngine", @ImportedSimpleName = "ScriptEngine", @PackageName = "javax.script", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "javax.script.ScriptEngineManager", @ImportedSimpleName = "ScriptEngineManager", @PackageName = "javax.script", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "TextBlocks", @CanonicalName = "TextBlocks", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "TextBlocks", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -19,7 +19,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] +- Block[@Empty = false, @Size = 25, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "html"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -32,7 +32,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "html", @Name = "html", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "query"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "query", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -45,7 +45,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "query", @Name = "query", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "ScriptEngine"] | +- VariableDeclarator[@Initializer = true, @Name = "engine"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "engine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -56,7 +56,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "js", @Empty = false, @Image = "\"js\"", @Length = 2, @LiteralText = "\"js\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "obj"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -65,7 +65,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "function hello() {\n print(\'\"Hello, world\"\');\n}\n\nhello();\n", @Empty = false, @Image = "\"\"\"\n function hello() {\n print(\'\"Hello, world\"\');\n }\n \n hello();\n \"\"\"", @Length = 60, @LiteralText = "\"\"\"\n function hello() {\n print(\'\"Hello, world\"\');\n }\n \n hello();\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "htmlWithEscapes"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "htmlWithEscapes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -78,61 +78,61 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "htmlWithEscapes", @Name = "htmlWithEscapes", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "season"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "season", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter", @Empty = false, @Image = "\"\"\"\n winter\"\"\"", @Length = 6, @LiteralText = "\"\"\"\n winter\"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "period"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "period", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter\n", @Empty = false, @Image = "\"\"\"\n winter\n \"\"\"", @Length = 7, @LiteralText = "\"\"\"\n winter\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi, \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @Length = 10, @LiteralText = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "salutation"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "salutation", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi,\n \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @Length = 11, @LiteralText = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "empty"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "empty", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"\"\n \"\"\"", @Length = 0, @LiteralText = "\"\"\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "quote"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "quote", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\"\n", @Empty = false, @Image = "\"\"\"\n \"\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "backslash"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "backslash", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\\\n", @Empty = false, @Image = "\"\"\"\n \\\\\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \\\\\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "normalStringLiteral"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "normalStringLiteral", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "code"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "code", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String text = \"\"\"\n A text block inside a text block\n\"\"\";\n", @Empty = false, @Image = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @Length = 60, @LiteralText = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "text"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -145,7 +145,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "colors"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "colors", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -158,7 +158,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "colors", @Name = "colors", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "emptyLine"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "emptyLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -175,7 +175,7 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\n", @Empty = false, @Image = "\"\\n\"", @Length = 1, @LiteralText = "\"\\n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = false, @Image = "\"\"", @Length = 4, @LiteralText = "\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "bs"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt index c1283873bf..f92cdd9cbf 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt @@ -1,37 +1,37 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations", @CanonicalName = "LocalClassAndInterfaceDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalClassAndInterfaceDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- Initializer[@Static = false] +- Block[@Empty = false, @Size = 3, @containsComment = true] +- LocalClassStatement[] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyLocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 3] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Static = true, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "constantField"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "constantField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Static = true, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = false, @Name = "staticField"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "staticField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "staticMethod", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- LocalClassStatement[] | +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalInterface", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = true, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "MyLocalInterface", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- LocalClassStatement[] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalClassAndInterfaceDeclarations$1MyLocalEnum", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = true, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyLocalEnum", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 1, @TrailingComma = false] +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_LOCAL, @Image = "A", @MethodName = "new", @Name = "A", @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "A", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt index bcdde4efd6..469d4d8963 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt @@ -2,53 +2,53 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.List", @ImportedSimpleName = "List", @PackageName = "java.util", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords", @CanonicalName = "LocalRecords", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalRecords", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 6] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$Merchant", @CanonicalName = "LocalRecords.Merchant", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Merchant", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "computeSales", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "month", @Name = "month", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "findTopMerchants", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchants", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MerchantSales", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MerchantSales", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "sales", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] @@ -64,7 +64,7 @@ | | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MerchantSales"] @@ -78,10 +78,10 @@ | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compare", @MethodName = "compare", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -103,78 +103,78 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalRecordAndModifiers", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord1", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord2", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord3", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord3", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord4", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord4", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | | +- Annotation[@SimpleName = "Deprecated"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalClass", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- LocalClassStatement[] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyLocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "MyLocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalVarsNamedSealed", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt index 1abb1176b2..260983fffe 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "NonSealedIdentifier", @CanonicalName = "NonSealedIdentifier", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NonSealedIdentifier", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -15,19 +15,19 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt index 542a7e19ae..8194cb8681 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt @@ -10,21 +10,21 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.annotation.ElementType", @ImportedSimpleName = "ElementType", @PackageName = "java.lang.annotation", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.annotation.Target", @ImportedSimpleName = "Target", @PackageName = "java.lang.annotation", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof", @CanonicalName = "PatternMatchingInstanceof", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternMatchingInstanceof", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "other string", @Empty = false, @Image = "\"other string\"", @Length = 12, @LiteralText = "\"other string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "test", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 8, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "obj"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -34,7 +34,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] @@ -86,7 +86,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] @@ -119,7 +119,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -145,7 +145,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -170,7 +170,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] @@ -202,7 +202,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "Deprecated"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -236,7 +236,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -266,11 +266,11 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -284,18 +284,18 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- ArgumentList[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof$Foo", @CanonicalName = "PatternMatchingInstanceof.Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- Initializer[@Static = false] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "f"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -306,7 +306,7 @@ | +- Annotation[@SimpleName = "Nullable"] | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof$Nullable", @CanonicalName = "PatternMatchingInstanceof.Nullable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nullable", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Target"] | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] | +- AnnotationMemberList[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt index 9adda51364..f7a424ed09 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt @@ -1,22 +1,22 @@ +- CompilationUnit[@PackageName = ""] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Point", @CanonicalName = "Point", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, final}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] +- RecordBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -24,7 +24,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt index 5a8b4f6a10..a06d3dde50 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt @@ -4,10 +4,10 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.lang.annotation.ElementType", @ImportedSimpleName = "ElementType", @PackageName = "java.lang.annotation", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Objects", @ImportedSimpleName = "Objects", @PackageName = "java.util", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records", @CanonicalName = "Records", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Records", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 10] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Records$Nullable", @CanonicalName = "Records.Nullable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nullable", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "Target"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -17,7 +17,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] | +- AnnotationTypeBody[@Empty = true, @Size = 0] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Records$MyAnnotation", @CanonicalName = "Records.MyAnnotation", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyAnnotation", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{abstract, static}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "Target"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] | | +- AnnotationMemberList[@Empty = false, @Size = 1] @@ -31,32 +31,32 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] | +- AnnotationTypeBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex", @CanonicalName = "Records.MyComplex", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyComplex", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 3] | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "MyComplex", @Name = "MyComplex", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "MyAnnotation"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | | +- FormalParameters[@Empty = false, @Size = 2] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- Annotation[@SimpleName = "MyAnnotation"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] @@ -80,30 +80,30 @@ | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "imaginary", @Name = "imaginary", @ParenthesisDepth = 0, @Parenthesized = false] | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex$Nested", @CanonicalName = "Records.MyComplex.Nested", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nested", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex$NestedClass", @CanonicalName = "Records.MyComplex.NestedClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NestedClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$Range", @CanonicalName = "Records.Range", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Range", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 2] | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "Range", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "MyAnnotation"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -123,20 +123,20 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$RecordWithLambdaInCompactConstructor", @CanonicalName = "Records.RecordWithLambdaInCompactConstructor", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "RecordWithLambdaInCompactConstructor", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "foo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 1] | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "RecordWithLambdaInCompactConstructor", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "requireNonNull", @MethodName = "requireNonNull", @ParenthesisDepth = 0, @Parenthesized = false] @@ -148,10 +148,10 @@ | +- LambdaParameterList[@Empty = true, @Size = 0] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "foo", @Empty = false, @Image = "\"foo\"", @Length = 3, @LiteralText = "\"foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$VarRec", @CanonicalName = "Records.VarRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "VarRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = true] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = true, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Nullable"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] | | | +- Annotation[@SimpleName = "Deprecated"] @@ -165,10 +165,10 @@ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$ArrayRec", @CanonicalName = "Records.ArrayRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ArrayRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -176,30 +176,30 @@ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$EmptyRec", @CanonicalName = "Records.EmptyRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "EmptyRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "Type", @Name = "Type", @TypeBound = false] | +- RecordComponentList[@Empty = true, @Size = 0, @Varargs = false] | +- RecordBody[@Empty = false, @Size = 3] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "bar", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ClassType[@FullyQualified = false, @SimpleName = "Type"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "baz", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "EmptyRec"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -217,25 +217,25 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Records$Person", @CanonicalName = "Records.Person", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Person", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, abstract, static}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "firstName", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- FormalParameters[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lastName", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, abstract}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$PersonRecord", @CanonicalName = "Records.PersonRecord", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "PersonRecord", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lastName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] +- ImplementsList[@Empty = false, @Size = 2] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt index f1dab975b5..55a5d5f606 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt @@ -1,14 +1,14 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalVars", @CanonicalName = "LocalVars", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalVars", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "aMethod", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 2, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt index 1ca67aec27..03417524db 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt @@ -1,24 +1,24 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses", @CanonicalName = "SealedInnerClasses", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SealedInnerClasses", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 2] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square", @CanonicalName = "SealedInnerClasses.Square", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Square", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED), @ExplicitModifiers = (JModifier.SEALED)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"] | +- ClassBody[@Empty = false, @Size = 2] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$OtherSquare", @CanonicalName = "SealedInnerClasses.Square.OtherSquare", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "OtherSquare", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, non-sealed}", @ExplicitModifiers = "{private, non-sealed}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.NON_SEALED), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.NON_SEALED)] | | +- ExtendsList[@Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] | | +- ClassBody[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$StaticClass", @CanonicalName = "SealedInnerClasses.Square.StaticClass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "StaticClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{non-sealed, static}", @ExplicitModifiers = "{non-sealed, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.NON_SEALED, JModifier.STATIC), @ExplicitModifiers = (JModifier.NON_SEALED, JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Squircle", @CanonicalName = "SealedInnerClasses.Squircle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Squircle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 2] | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] | +- ClassType[@FullyQualified = false, @SimpleName = "StaticClass"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt index 51c3723317..016661bb86 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt @@ -1,8 +1,8 @@ +- CompilationUnit[@PackageName = "com.example.expression"] +- PackageDeclaration[@Name = "com.example.expression"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.expression.Expr", @CanonicalName = "com.example.expression.Expr", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = false, @PackageName = "com.example.expression", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Expr", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, sealed, abstract}", @ExplicitModifiers = "{public, sealed}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 4] | +- ClassType[@FullyQualified = false, @SimpleName = "ConstantExpr"] | +- ClassType[@FullyQualified = false, @SimpleName = "PlusExpr"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt index 75e751d3a5..f66d9db66f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt @@ -1,8 +1,8 @@ +- CompilationUnit[@PackageName = "com.example.geometry"] +- PackageDeclaration[@Name = "com.example.geometry"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.geometry.Shape", @CanonicalName = "com.example.geometry.Shape", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.example.geometry", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, sealed}", @ExplicitModifiers = "{public, sealed}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.SEALED), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 3] | +- ClassType[@FullyQualified = false, @SimpleName = "Circle"] | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt index 35eac43c54..f5fe375c73 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt @@ -1,8 +1,8 @@ +- CompilationUnit[@PackageName = "com.example.geometry"] +- PackageDeclaration[@Name = "com.example.geometry"] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.geometry.Square", @CanonicalName = "com.example.geometry.Square", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.example.geometry", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Square", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, non-sealed}", @ExplicitModifiers = "{public, non-sealed}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.NON_SEALED), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.NON_SEALED)] +- ExtendsList[@Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt index c28bf13143..ac3fa81e26 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt @@ -1,6 +1,6 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers", @CanonicalName = "AnnotationValueInitializers", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "MyAnnotation"] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | | +- AnnotationMemberList[@Empty = false, @Size = 2] @@ -11,7 +11,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers2", @CanonicalName = "AnnotationValueInitializers2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers2", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "MyAnnotation"] | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | +- AnnotationMemberList[@Empty = false, @Size = 2] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index 2aeb8ee6fb..09c4c440bc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "DealingWithNull", @CanonicalName = "DealingWithNull", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "DealingWithNull", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 6] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testFooBar", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -41,11 +41,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -54,7 +54,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -83,11 +83,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrDefaultNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -96,7 +96,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -117,11 +117,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null or default case", @Empty = false, @Image = "\"null or default case\"", @Length = 20, @LiteralText = "\"null or default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -137,7 +137,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -151,7 +151,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -169,11 +169,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default", @Empty = false, @Image = "\"default\"", @Length = 7, @LiteralText = "\"default\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] @@ -193,7 +193,7 @@ | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] @@ -228,7 +228,7 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -271,11 +271,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -298,7 +298,7 @@ | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt index cd6a3c0a40..2bc4a023cf 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -1,37 +1,37 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch", @CanonicalName = "EnhancedTypeCheckingSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "EnhancedTypeCheckingSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 4] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Point", @CanonicalName = "EnhancedTypeCheckingSwitch.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Color", @CanonicalName = "EnhancedTypeCheckingSwitch.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -49,7 +49,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -61,7 +61,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -77,7 +77,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -93,7 +93,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -117,11 +117,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Something else", @Empty = false, @Image = "\"Something else\"", @Length = 14, @LiteralText = "\"Something else\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -129,7 +129,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 9, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index 87d5c24cf7..5b58423b5a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch", @CanonicalName = "ExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 13] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverage", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -17,7 +17,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -26,7 +26,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] @@ -34,11 +34,11 @@ | +- SwitchLabel[@Default = true] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "coverageStatement", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -47,7 +47,7 @@ | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] @@ -61,7 +61,7 @@ | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] @@ -76,38 +76,38 @@ | +- SwitchLabel[@Default = true] | +- BreakStatement[@Label = null] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 3] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -117,30 +117,30 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -149,7 +149,7 @@ | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] @@ -163,7 +163,7 @@ | | +- SwitchFallthroughBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] @@ -186,7 +186,7 @@ | | +- BreakStatement[@Label = null] | +- EmptyStatement[] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$I", @CanonicalName = "ExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- PermitsList[@Empty = false, @Size = 2] @@ -194,7 +194,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] | +- ImplementsList[@Empty = false, @Size = 1] @@ -203,7 +203,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "Y", @Name = "Y", @TypeBound = false] | +- ImplementsList[@Empty = false, @Size = 1] @@ -212,11 +212,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Y"] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -228,18 +228,18 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index 54d9d2c408..a09c9ddbae 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns", @CanonicalName = "GuardedPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GuardedPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 8] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -16,7 +16,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -34,7 +34,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -46,7 +46,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -70,11 +70,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -86,12 +86,12 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "when"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -104,14 +104,14 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns$when", @CanonicalName = "GuardedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static}", @ExplicitModifiers = "{private, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testWithNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -120,7 +120,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -138,7 +138,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -150,7 +150,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -183,11 +183,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "instanceOfPattern", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] @@ -197,7 +197,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -223,7 +223,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -245,7 +245,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] @@ -262,11 +262,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @Empty = false, @Image = "\"A string containing at least four characters\"", @Length = 44, @LiteralText = "\"A string containing at least four characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testScopeOfPatternVariableDeclarations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -276,7 +276,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -301,11 +301,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a string", @Empty = false, @Image = "\"Not a string\"", @Length = 12, @LiteralText = "\"Not a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -340,7 +340,7 @@ | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 2e2cb11e5a..6e0d10978e 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -1,25 +1,25 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns", @CanonicalName = "Jep440_RecordPatterns", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep440_RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 15] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Point", @CanonicalName = "Jep440_RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -31,11 +31,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -49,47 +49,47 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Color", @CanonicalName = "Jep440_RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$ColoredPoint", @CanonicalName = "Jep440_RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Rectangle", @CanonicalName = "Jep440_RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -104,15 +104,15 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -124,11 +124,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -146,19 +146,19 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -172,24 +172,24 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Pair", @CanonicalName = "Jep440_RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "patternsCanFailToMatch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -206,11 +206,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -234,27 +234,27 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$MyPair", @CanonicalName = "Jep440_RecordPatterns.MyPair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyPair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 2] | | +- TypeParameter[@Image = "S", @Name = "S", @TypeBound = false] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EmptyDeclaration[] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "recordInference", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -269,11 +269,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -283,21 +283,21 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "matched", @Empty = false, @Image = "\"matched\"", @Length = 7, @LiteralText = "\"matched\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Box", @CanonicalName = "Jep440_RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] @@ -320,7 +320,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -334,11 +334,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] @@ -357,7 +357,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt index a8536752f3..3e64a5beb7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch", @CanonicalName = "Jep441_PatternMatchingForSwitch", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep441_PatternMatchingForSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 13] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "formatterPatternSwitch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -17,7 +17,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -29,7 +29,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -41,7 +41,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -53,7 +53,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -68,11 +68,11 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testFooBarNew", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -106,11 +106,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringNew", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -123,7 +123,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -142,7 +142,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -161,7 +161,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -173,11 +173,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Sorry?", @Empty = false, @Image = "\"Sorry?\"", @Length = 6, @LiteralText = "\"Sorry?\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringEnhanced", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -214,7 +214,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -233,7 +233,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -252,7 +252,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -264,39 +264,39 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Sorry?", @Empty = false, @Image = "\"Sorry?\"", @Length = 6, @LiteralText = "\"Sorry?\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$CardClassification", @CanonicalName = "Jep441_PatternMatchingForSwitch.CardClassification", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "CardClassification", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 2] | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | +- ClassBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Suit", @CanonicalName = "Jep441_PatternMatchingForSwitch.Suit", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Suit", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 4, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "CLUBS", @MethodName = "new", @Name = "CLUBS", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "CLUBS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "DIAMONDS", @MethodName = "new", @Name = "DIAMONDS", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "DIAMONDS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "HEARTS", @MethodName = "new", @Name = "HEARTS", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEARTS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "SPADES", @MethodName = "new", @Name = "SPADES", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SPADES", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Tarot", @CanonicalName = "Jep441_PatternMatchingForSwitch.Tarot", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Tarot", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exhaustiveSwitchWithoutEnumSupport", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -305,7 +305,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -325,7 +325,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -345,7 +345,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -365,7 +365,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -379,7 +379,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -391,11 +391,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @Empty = false, @Image = "\"It\'s a tarot\"", @Length = 12, @LiteralText = "\"It\'s a tarot\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exhaustiveSwitchWithBetterEnumSupport", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -456,7 +456,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -468,27 +468,27 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @Empty = false, @Image = "\"It\'s a tarot\"", @Length = 12, @LiteralText = "\"It\'s a tarot\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Currency", @CanonicalName = "Jep441_PatternMatchingForSwitch.Currency", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Currency", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] | +- ClassBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Coin", @CanonicalName = "Jep441_PatternMatchingForSwitch.Coin", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Coin", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Currency"] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 2, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "HEADS", @MethodName = "new", @Name = "HEADS", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEADS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "TAILS", @MethodName = "new", @Name = "TAILS", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TAILS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "goodEnumSwitch1", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Currency"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -521,11 +521,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tails", @Empty = false, @Image = "\"Tails\"", @Length = 5, @LiteralText = "\"Tails\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "goodEnumSwitch2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt index ae159ed7ae..26347cab9b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternsInSwitchLabels", @CanonicalName = "PatternsInSwitchLabels", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PatternsInSwitchLabels", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -15,13 +15,13 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 3, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -30,7 +30,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -42,7 +42,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -54,7 +54,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] @@ -66,7 +66,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt index 7603475c02..bdd1ce8066 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -1,61 +1,61 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 18] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -64,12 +64,12 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -77,7 +77,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "y"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -94,11 +94,11 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -110,11 +110,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -128,11 +128,11 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printUpperLeftColoredPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -144,11 +144,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -162,11 +162,11 @@ | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -181,15 +181,15 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -201,36 +201,36 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "createRectangle", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | +- FormalParameters[@Empty = false, @Size = 6] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -258,11 +258,11 @@ | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -280,19 +280,19 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -306,24 +306,24 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Pair", @CanonicalName = "RecordPatterns.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -340,11 +340,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -368,21 +368,21 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] @@ -398,7 +398,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -412,11 +412,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -432,7 +432,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -446,11 +446,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -464,7 +464,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -478,11 +478,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] @@ -505,7 +505,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -519,11 +519,11 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] @@ -542,7 +542,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt index 8f22b50ebf..1d0d121f32 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -1,52 +1,52 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch", @CanonicalName = "RecordPatternsExhaustiveSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatternsExhaustiveSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 7] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$A", @CanonicalName = "RecordPatternsExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract, static}", @ExplicitModifiers = "{sealed}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 2] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] @@ -54,7 +54,7 @@ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] @@ -71,11 +71,11 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -92,11 +92,11 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -113,11 +113,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -136,11 +136,11 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -157,11 +157,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -180,11 +180,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -201,11 +201,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -222,11 +222,11 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- PatternList[@Empty = false, @Size = 2] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "D"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index d91c4f8546..058cbaefed 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -1,30 +1,30 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch", @CanonicalName = "RefiningPatternsInSwitch", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RefiningPatternsInSwitch", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 7] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Shape", @CanonicalName = "RefiningPatternsInSwitch.Shape", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] | +- ClassBody[@Empty = false, @Size = 3] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = false, @Name = "area"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Triangle", @Name = "Triangle", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -34,18 +34,18 @@ | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "calculateArea", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "area", @Name = "area", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangle", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -58,7 +58,7 @@ | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] @@ -86,11 +86,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -104,7 +104,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -128,11 +128,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -146,7 +146,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -164,7 +164,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -182,11 +182,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Non-triangle", @Empty = false, @Image = "\"Non-triangle\"", @Length = 12, @LiteralText = "\"Non-triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -194,7 +194,7 @@ | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 12, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "large"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -203,7 +203,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LiteralText = "200", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "small"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -212,7 +212,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | +- VariableDeclarator[@Initializer = true, @Name = "rect"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index 3c1ff573aa..bcce204419 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ScopeOfPatternVariableDeclarations", @CanonicalName = "ScopeOfPatternVariableDeclarations", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopeOfPatternVariableDeclarations", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ClassBody[@Empty = false, @Size = 4] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchBlock", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -16,7 +16,7 @@ | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -37,11 +37,11 @@ | +- SwitchLabel[@Default = true] | +- BreakStatement[@Label = null] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSwitchRule", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -50,7 +50,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -78,7 +78,7 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ThrowStatement[] @@ -95,11 +95,11 @@ | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- BreakStatement[@Label = null] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -108,7 +108,7 @@ | +- SwitchFallthroughBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] @@ -156,11 +156,11 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fall-through", @Empty = false, @Image = "\"fall-through\"", @Length = 12, @LiteralText = "\"fall-through\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -183,7 +183,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt index a1124094d6..dff0ab9939 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt @@ -5,43 +5,43 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.format.DateTimeFormatter", @ImportedSimpleName = "DateTimeFormatter", @PackageName = "java.time.format", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.LocalTime", @ImportedSimpleName = "LocalTime", @PackageName = "java.time", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates", @CanonicalName = "Jep430_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep430_StringTemplates", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 9] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$Request", @CanonicalName = "Jep430_StringTemplates.Request", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Request", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 19, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -54,7 +54,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -67,7 +67,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -76,7 +76,7 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -93,7 +93,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -105,7 +105,7 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -116,7 +116,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -134,13 +134,13 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -149,7 +149,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -168,7 +168,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -186,7 +186,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -207,13 +207,13 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "index"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -234,7 +234,7 @@ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -246,7 +246,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -272,7 +272,7 @@ | | | +- TemplateFragment[@Content = "}\""] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -298,31 +298,31 @@ | | +- TemplateFragment[@Content = "}\""] | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "_getOfferType_", @Empty = false, @Image = "\"_getOfferType_\"", @Length = 14, @LiteralText = "\"_getOfferType_\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 10, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -335,25 +335,25 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -369,23 +369,23 @@ | | +- TemplateFragment[@Content = "}\"\n }\n \"\"\""] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -394,7 +394,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -426,7 +426,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -516,29 +516,29 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = true] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$2Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -548,7 +548,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | +- EmptyStatement[] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -580,7 +580,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -675,18 +675,18 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -697,7 +697,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -706,24 +706,24 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep430_StringTemplates$User", @CanonicalName = "Jep430_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -732,7 +732,7 @@ | | +- Template[] | | +- TemplateFragment[@Content = "\"Welcome to your account\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -742,7 +742,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -759,12 +759,12 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index 6429a5a730..7b39af7263 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -4,51 +4,51 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables", @CanonicalName = "Jep443_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep443_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 19] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -71,11 +71,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -105,11 +105,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- UnnamedPattern[] @@ -126,45 +126,45 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract}", @ExplicitModifiers = "{sealed, abstract}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.SEALED, JModifier.ABSTRACT)] | +- PermitsList[@Empty = false, @Size = 3] | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 5, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -186,7 +186,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -198,7 +198,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -210,7 +210,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] @@ -223,14 +223,14 @@ | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -242,7 +242,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] @@ -256,7 +256,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -269,14 +269,14 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -295,11 +295,11 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -307,51 +307,51 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "total"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -377,7 +377,7 @@ | +- ForStatement[] | | +- ForInit[] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -402,7 +402,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -420,7 +420,7 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | +- Block[@Empty = false, @Size = 4, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -428,7 +428,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -436,7 +436,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -444,7 +444,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -461,28 +461,28 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -492,19 +492,19 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Override"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -513,7 +513,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 4, @containsComment = false] @@ -521,7 +521,7 @@ | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] | | +- Resource[@ConciseResource = false, @StableName = "_"] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] @@ -530,7 +530,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -538,7 +538,7 @@ +- TryStatement[@TryWithResources = false] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -556,7 +556,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -571,7 +571,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -603,6 +603,6 @@ +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt index 8bafb59ab5..4826a0bcb2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt @@ -1,6 +1,6 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt index 200582f309..95f5757567 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt index aa91140674..66f34f82b4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt @@ -1,12 +1,12 @@ +- CompilationUnit[@PackageName = ""] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt index 3de46269b6..da6abec815 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -4,51 +4,51 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Queue", @ImportedSimpleName = "Queue", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables", @CanonicalName = "Jep456_UnamedPatternsAndVariables", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep456_UnamedPatternsAndVariables", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 19] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Point", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] - | | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -71,11 +71,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -105,11 +105,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- UnnamedPattern[] @@ -126,45 +126,45 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " ", @Empty = false, @Image = "\" \"", @Length = 1, @LiteralText = "\" \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{sealed, abstract}", @ExplicitModifiers = "{sealed, abstract}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.SEALED, JModifier.ABSTRACT)] | +- PermitsList[@Empty = false, @Size = 3] | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 5, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -186,7 +186,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -198,7 +198,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -210,7 +210,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] @@ -223,14 +223,14 @@ | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -242,7 +242,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] @@ -256,7 +256,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -269,14 +269,14 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] @@ -295,11 +295,11 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "processBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] @@ -307,51 +307,51 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "pickAnotherBox", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Order", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Order", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Order", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = true, @Size = 0] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] - | +- ModifierList[@EffectiveModifiers = "{private, static, final}", @ExplicitModifiers = "{private, static, final}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedVariables", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VoidType[] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "total"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -377,7 +377,7 @@ | +- ForStatement[] | | +- ForInit[] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -402,7 +402,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -420,7 +420,7 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | +- Block[@Empty = false, @Size = 4, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -428,7 +428,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -436,7 +436,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -444,7 +444,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -461,28 +461,28 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -492,19 +492,19 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] - | | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Override"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -513,7 +513,7 @@ | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 4, @containsComment = false] @@ -521,7 +521,7 @@ | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] | | +- Resource[@ConciseResource = false, @StableName = "_"] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] @@ -530,7 +530,7 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -538,7 +538,7 @@ +- TryStatement[@TryWithResources = false] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -556,7 +556,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -571,7 +571,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -603,6 +603,6 @@ +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt index aad782bbad..acd50b8006 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt @@ -5,27 +5,27 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.DSAPublicKey", @ImportedSimpleName = "DSAPublicKey", @PackageName = "java.security.interfaces", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.security.interfaces.RSAKey", @ImportedSimpleName = "RSAKey", @PackageName = "java.security.interfaces", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper", @CanonicalName = "Jep447_StatementsBeforeSuper", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep447_StatementsBeforeSuper", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 9] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Old", @CanonicalName = "Jep447_StatementsBeforeSuper.Old", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Old", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Old", @Name = "Old", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$PositiveBigInteger", @CanonicalName = "Jep447_StatementsBeforeSuper.PositiveBigInteger", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PositiveBigInteger", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "BigInteger"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "PositiveBigInteger", @Name = "PositiveBigInteger", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] @@ -39,7 +39,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "non-positive value", @Empty = false, @Image = "\"non-positive value\"", @Length = 18, @LiteralText = "\"non-positive value\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -52,13 +52,13 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "valueAsString", @Name = "valueAsString", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super", @CanonicalName = "Jep447_StatementsBeforeSuper.Super", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Super", @Name = "Super", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -66,20 +66,20 @@ | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Super"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Sub", @Name = "Sub", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "publicKey"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getPublicKey", @MethodName = "getPublicKey", @ParenthesisDepth = 0, @Parenthesized = false] @@ -95,7 +95,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null certificate", @Empty = false, @Image = "\"null certificate\"", @Length = 16, @LiteralText = "\"null certificate\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{final}", @ExplicitModifiers = "{final}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- ArrayType[@ArrayDepth = 1] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -107,7 +107,7 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] @@ -121,7 +121,7 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] - | | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] @@ -144,38 +144,38 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "byteArray", @Name = "byteArray", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$F", @CanonicalName = "Jep447_StatementsBeforeSuper.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Super2", @CanonicalName = "Jep447_StatementsBeforeSuper.Super2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Super2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static}", @ExplicitModifiers = "{public, static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Super2", @Name = "Super2", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Super2"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Sub2", @Name = "Sub2", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = true] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "f"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] @@ -186,30 +186,30 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Range", @CanonicalName = "Jep447_StatementsBeforeSuper.Range", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Range", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 3, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Range", @Name = "Range", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{public}", @ExplicitModifiers = "{public}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 3] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] @@ -251,22 +251,22 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Color", @CanonicalName = "Jep447_StatementsBeforeSuper.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] - +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{public}"] + +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 4, @TrailingComma = false] +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] - | +- ModifierList[@EffectiveModifiers = "{public, static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "Color", @Name = "Color", @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "Color", @Name = "Color", @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] - | +- ModifierList[@EffectiveModifiers = "{private}", @ExplicitModifiers = "{private}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt index c65df30abd..969a8c9b36 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt @@ -5,43 +5,43 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.format.DateTimeFormatter", @ImportedSimpleName = "DateTimeFormatter", @PackageName = "java.time.format", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.time.LocalTime", @ImportedSimpleName = "LocalTime", @PackageName = "java.time", @Static = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates", @CanonicalName = "Jep459_StringTemplates", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Jep459_StringTemplates", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassBody[@Empty = false, @Size = 9] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$Request", @CanonicalName = "Jep459_StringTemplates.Request", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Request", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 19, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -54,7 +54,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lastName", @Name = "lastName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -67,7 +67,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "firstName", @Name = "firstName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -76,7 +76,7 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -93,7 +93,7 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -105,7 +105,7 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -116,7 +116,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -134,13 +134,13 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "req", @Name = "req", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -149,7 +149,7 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -168,7 +168,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -186,7 +186,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "does not", @Empty = false, @Image = "\"does not\"", @Length = 8, @LiteralText = "\"does not\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -207,13 +207,13 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "index"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -234,7 +234,7 @@ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "index", @Name = "index", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -246,7 +246,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -272,7 +272,7 @@ | | | +- TemplateFragment[@Content = "}\""] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -298,31 +298,31 @@ | | +- TemplateFragment[@Content = "}\""] | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "_getOfferType_", @Empty = false, @Image = "\"_getOfferType_\"", @Length = 14, @LiteralText = "\"_getOfferType_\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "multilineTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 10, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -335,25 +335,25 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -369,23 +369,23 @@ | | +- TemplateFragment[@Content = "}\"\n }\n \"\"\""] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$1Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -394,7 +394,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "width", @Name = "width", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -426,7 +426,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -516,29 +516,29 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "FMTTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = true] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$2Rectangle", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -548,7 +548,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "height", @Name = "height", @ParenthesisDepth = 0, @Parenthesized = false] | +- EmptyStatement[] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] @@ -580,7 +580,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -675,18 +675,18 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\n \"\"\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "ensuringSafety", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -697,7 +697,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "name", @Name = "name", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -706,24 +706,24 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "st", @Name = "st", @ParenthesisDepth = 0, @Parenthesized = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep459_StringTemplates$User", @CanonicalName = "Jep459_StringTemplates.User", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "User", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{static, final}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] - | | +- ModifierList[@EffectiveModifiers = "{private, final}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - | +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -732,7 +732,7 @@ | | +- Template[] | | +- TemplateFragment[@Content = "\"Welcome to your account\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -742,7 +742,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -759,12 +759,12 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "emptyEmbeddedExpression", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{static}", @ExplicitModifiers = "{static}"] + +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt index 8bafb59ab5..4826a0bcb2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt @@ -1,6 +1,6 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt index 200582f309..95f5757567 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt @@ -1,13 +1,13 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt index aa91140674..66f34f82b4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt @@ -1,12 +1,12 @@ +- CompilationUnit[@PackageName = ""] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt index bca2c8a46c..5b20d948df 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt @@ -2,7 +2,7 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.Arrays", @ImportedSimpleName = "Arrays", @PackageName = "java.util", @Static = false] +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] - | +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] @@ -22,7 +22,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] - +- ModifierList[@EffectiveModifiers = "{}", @ExplicitModifiers = "{}"] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- VoidType[] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] From 62443a4c339eba94adf1d941b4b591e283a61355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 02:12:24 -0300 Subject: [PATCH 015/121] Update tree export test --- .../net/sourceforge/pmd/cli/TreeExportCliTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/TreeExportCliTest.java b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/TreeExportCliTest.java index f446439516..6e7ba26db4 100644 --- a/pmd-cli/src/test/java/net/sourceforge/pmd/cli/TreeExportCliTest.java +++ b/pmd-cli/src/test/java/net/sourceforge/pmd/cli/TreeExportCliTest.java @@ -31,9 +31,9 @@ class TreeExportCliTest extends BaseCliTest { final CliExecutionResult output = runCliSuccessfully("-i", "-f", "xml", "-PlineSeparator=LF"); output.checkStdOut(equalTo("\n" - + "\n" - + " \n" - + " \n" + + "\n" + + " \n" + + " \n" + " \n" + "\n")); }); @@ -44,9 +44,9 @@ class TreeExportCliTest extends BaseCliTest { File file = newFileWithContents("(a(b))"); final CliExecutionResult result = runCliSuccessfully("--file", file.getAbsolutePath(), "-f", "xml", "-PlineSeparator=LF"); result.checkStdOut(equalTo("\n" - + "\n" - + " \n" - + " \n" + + "\n" + + " \n" + + " \n" + " \n" + "\n")); } From 1231a54300c086d65932e7b70540ebe8e38607fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 08:56:48 -0300 Subject: [PATCH 016/121] Remove unsused imports --- .../sourceforge/pmd/lang/java/JavaAttributesPrinter.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java index 9353eb5336..bb93d65c76 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/JavaAttributesPrinter.java @@ -4,17 +4,11 @@ package net.sourceforge.pmd.lang.java; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - import org.checkerframework.checker.nullness.qual.NonNull; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; -import net.sourceforge.pmd.lang.java.ast.ASTModifierList; -import net.sourceforge.pmd.lang.java.ast.JModifier; import net.sourceforge.pmd.lang.java.ast.ModifierOwner; import net.sourceforge.pmd.lang.rule.xpath.Attribute; import net.sourceforge.pmd.lang.test.ast.RelevantAttributePrinter; From 346d7fd0dcde6398e55673bd4abe52c25c1d488b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 09:02:16 -0300 Subject: [PATCH 017/121] Do not warn for List being deprecated by default --- .../net/sourceforge/pmd/lang/rule/xpath/Attribute.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java index 3b032e558f..54edbcb3d9 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java @@ -106,16 +106,11 @@ public final class Attribute { return null; } else { DeprecatedAttribute annot = method.getAnnotation(DeprecatedAttribute.class); - String result = annot != null + return annot != null ? annot.replaceWith() : method.isAnnotationPresent(Deprecated.class) ? DeprecatedAttribute.NO_REPLACEMENT : null; - if (result == null && List.class.isAssignableFrom(method.getReturnType())) { - // Lists are generally deprecated, see #2451 - result = DeprecatedAttribute.NO_REPLACEMENT; - } - return result; } } From 3650622645f70b358aecbbb5f8482e232abae4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Fri, 19 Apr 2024 09:08:21 -0300 Subject: [PATCH 018/121] Remove unused imports --- .../main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java index 54edbcb3d9..3bf41f5f4e 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/Attribute.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.rule.xpath; import java.lang.invoke.MethodHandle; import java.lang.reflect.Method; import java.lang.reflect.Type; -import java.util.List; import java.util.Objects; import org.checkerframework.checker.nullness.qual.NonNull; From b510f77a7951550de434a26a2230badcd58efaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 20:47:21 -0300 Subject: [PATCH 019/121] Add failing test for #4980 --- .../pmd/lang/java/types/TypeGenerationUtil.kt | 1 + .../internal/infer/PolyResolutionTest.kt | 28 +++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt index 69260414da..145be6f6b4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeGenerationUtil.kt @@ -145,6 +145,7 @@ class RefTypeConstants(override val ts: TypeSystem) : TypeDslMixin { val `t_Enum{E}`: JClassType get() = java.lang.Enum::class.decl val t_Stream: JClassType get() = java.util.stream.Stream::class.raw + val `t_Stream{Number}`: JClassType get() = java.util.stream.Stream::class[t_Number] val t_Function: JClassType get() = java.util.function.Function::class.raw val t_Map: JClassType get() = java.util.Map::class.raw val t_MapEntry: JClassType get() = java.util.Map.Entry::class.raw diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 6405b99afb..99618ae017 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -5,10 +5,10 @@ package net.sourceforge.pmd.lang.java.types.internal.infer -import net.sourceforge.pmd.lang.test.ast.shouldBe -import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* +import net.sourceforge.pmd.lang.test.ast.shouldBe +import net.sourceforge.pmd.lang.test.ast.shouldMatchN import java.io.BufferedOutputStream import java.io.DataOutputStream import java.io.OutputStream @@ -21,7 +21,6 @@ import java.io.OutputStream */ class PolyResolutionTest : ProcessorTestSpec({ - parserTest("Test context passing overcomes null lower bound") { val (acu, spy) = parser.parseWithTypeInferenceSpy(""" @@ -373,4 +372,27 @@ class Scratch { lambda3 shouldHaveType Runnable::class.decl } } + + parserTest("Test inference with varargs - bug #4980") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + import java.util.stream.Stream; + + class Foo { + public T foo() { + return null; + } + + public Stream bar() { + return Stream.of(foo()); + } + } + """) + + val call = acu.firstMethodCall() + + spy.shouldBeOk { + call shouldHaveType gen.`t_Stream{Number}` + } + } }) From 0a7a52f228a5c8ec95ac3fa4f394d1a518db8a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 20:50:13 -0300 Subject: [PATCH 020/121] Fix issue #4980 - When an applicability test fails (ie: during LUB) we don't want that to bubble up and fail the process, simply to discard the candidate and move forward. If no matching candidate is found, the inference will fail anyway. --- .../pmd/lang/java/types/internal/infer/Infer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java index 595bf77921..0330717e04 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java @@ -577,7 +577,12 @@ public final class Infer { // we only test it can reduce, we don't commit inferred types at this stage InferenceContext ctxCopy = infCtx.copy(); LOG.applicabilityTest(ctxCopy, m); - ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); + try { + ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); + } catch (ResolutionFailedException | IllegalArgumentException ignored) { + // applicability test failed for this candidate, but continue with others + return null; + } // if unchecked conversion was needed, update the site for invocation pass if (ctxCopy.needsUncheckedConversion()) { From 6ab54e1afb44436c7f21f4333544729f5bf9084a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 20:56:27 -0300 Subject: [PATCH 021/121] Make the code actually valid --- .../pmd/lang/java/types/internal/infer/PolyResolutionTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 99618ae017..17d131376a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -48,7 +48,7 @@ class PolyResolutionTest : ProcessorTestSpec({ static T id(T t) { return t; } - { + void foo(int x) { id(x > 0 ? Double.POSITIVE_INFINITY : x < 0 ? Double.NEGATIVE_INFINITY : Double.NaN); From d2e0826ed81e4b9eb905d9055ad900564ffb92bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 21:19:57 -0300 Subject: [PATCH 022/121] Improve implementation - throw an apropriate ResolutionFailedException so we don't loose the message - handle any exception so we don't couple tightly into the LUB implementation --- .../pmd/lang/java/types/internal/infer/Infer.java | 4 ++-- .../internal/infer/ResolutionFailedException.java | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java index 0330717e04..763342539d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java @@ -579,9 +579,9 @@ public final class Infer { LOG.applicabilityTest(ctxCopy, m); try { ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); - } catch (ResolutionFailedException | IllegalArgumentException ignored) { + } catch (Throwable e) { // applicability test failed for this candidate, but continue with others - return null; + throw ResolutionFailedException.fromThrowable(LOG, e); } // if unchecked conversion was needed, update the site for invocation pass diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java index b955129c56..0e98d18c74 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java @@ -55,6 +55,17 @@ final class ResolutionFailedException extends RuntimeException { // If the logger is noop we don't even create the failure. // These failures are extremely frequent (and normal), and type pretty-printing is expensive + static ResolutionFailedException fromThrowable(TypeInferenceLogger logger, Throwable t) { + if (t instanceof ResolutionFailedException) { + return (ResolutionFailedException) t; + } + + return getShared(logger.isNoop() ? UNKNOWN : new ResolutionFailure( + null, + t.getMessage() + )); + } + static ResolutionFailedException incompatibleBound(TypeInferenceLogger logger, InferenceVar ivar, BoundKind k1, JTypeMirror b1, BoundKind k2, JTypeMirror b2) { // in javac it's "no instance of type variables exist ..." return getShared(logger.isNoop() ? UNKNOWN : new ResolutionFailure( From a77519399e8286336da439c0bc5efe54e64a4085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sat, 27 Apr 2024 21:23:01 -0300 Subject: [PATCH 023/121] Update changelog, refs #4980 --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 2a0c2c81f0..b6d3b0edc1 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -16,6 +16,8 @@ This is a {{ site.pmd.release_type }} release. ### ๐Ÿ› Fixed Issues +* java + * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test From 42cf1b568d18789571e7c40f0f0fd2511d2bca03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 00:17:44 -0300 Subject: [PATCH 024/121] Don't use Throwable --- .../pmd/lang/java/types/internal/infer/Infer.java | 4 ++-- .../types/internal/infer/ResolutionFailedException.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java index 763342539d..6de215c6d2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java @@ -579,9 +579,9 @@ public final class Infer { LOG.applicabilityTest(ctxCopy, m); try { ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); - } catch (Throwable e) { + } catch (Exception e) { // applicability test failed for this candidate, but continue with others - throw ResolutionFailedException.fromThrowable(LOG, e); + throw ResolutionFailedException.fromException(LOG, e); } // if unchecked conversion was needed, update the site for invocation pass diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java index 0e98d18c74..4ea2c0aa97 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java @@ -55,14 +55,14 @@ final class ResolutionFailedException extends RuntimeException { // If the logger is noop we don't even create the failure. // These failures are extremely frequent (and normal), and type pretty-printing is expensive - static ResolutionFailedException fromThrowable(TypeInferenceLogger logger, Throwable t) { - if (t instanceof ResolutionFailedException) { - return (ResolutionFailedException) t; + static ResolutionFailedException fromException(TypeInferenceLogger logger, Exception e) { + if (e instanceof ResolutionFailedException) { + return (ResolutionFailedException) e; } return getShared(logger.isNoop() ? UNKNOWN : new ResolutionFailure( null, - t.getMessage() + e.getMessage() )); } From 28c5cd71146e68518e9f48fb91462659d1b6ae7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:18:36 -0300 Subject: [PATCH 025/121] Remove `@Names` attribute from ASTReferenceExpression --- .../lang/apex/ast/ASTReferenceExpression.java | 3 +++ .../pmd/lang/apex/ast/InnerClassLocations.txt | 8 +++--- .../lang/apex/ast/SafeNavigationOperator.txt | 26 +++++++++---------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.java index dbf9e887ec..22378be985 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTReferenceExpression.java @@ -7,6 +7,8 @@ package net.sourceforge.pmd.lang.apex.ast; import java.util.List; import java.util.stream.Collectors; +import net.sourceforge.pmd.lang.rule.xpath.NoAttribute; + import com.google.summit.ast.Identifier; public final class ASTReferenceExpression extends AbstractApexNode.Many { @@ -38,6 +40,7 @@ public final class ASTReferenceExpression extends AbstractApexNode.Many getNames() { return nodes.stream().map(Identifier::getString).collect(Collectors.toList()); } diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt index 095e8b8803..4f71b48450 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/InnerClassLocations.txt @@ -8,11 +8,11 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] | +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar1", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar1", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar1", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar1", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] +- UserClass[@DefiningType = "InnerClassLocations.bar2", @Image = "bar2", @InterfaceNames = (), @RealLoc = true, @SimpleName = "bar2", @SuperClassName = ""] +- ModifierNode[@Abstract = false, @DefiningType = "InnerClassLocations.bar2", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 1, @Override = false, @Private = false, @Protected = false, @Public = true, @RealLoc = true, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] @@ -21,9 +21,9 @@ +- BlockStatement[@CurlyBrace = true, @DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] +- ExpressionStatement[@DefiningType = "InnerClassLocations.bar2", @RealLoc = true] +- MethodCallExpression[@DefiningType = "InnerClassLocations.bar2", @FullMethodName = "System.out.println", @InputParametersSize = 1, @MethodName = "println", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @Names = ("System", "out"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + +- ReferenceExpression[@DefiningType = "InnerClassLocations.bar2", @Image = "System", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] +- LiteralExpression[@Boolean = false, @Decimal = false, @DefiningType = "InnerClassLocations.bar2", @Double = false, @Image = "foo", @Integer = false, @LiteralType = LiteralType.STRING, @Long = false, @Name = null, @Null = false, @RealLoc = true, @String = true] diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt index 226b07f37a..d044128082 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/ast/SafeNavigationOperator.txt @@ -9,7 +9,7 @@ | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "x", @Name = "x", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "anIntegerField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "anObject", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "x", @RealLoc = true] @@ -18,9 +18,9 @@ | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- FieldDeclaration[@DefiningType = "Foo", @Image = "profileUrl", @Name = "profileUrl", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "toExternalForm", @InputParametersSize = 0, @MethodName = "toExternalForm", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "user.getProfileUrl", @InputParametersSize = 0, @MethodName = "getProfileUrl", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @Names = ("user"), @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "user", @RealLoc = true, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "profileUrl", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 1, @CanonicalName = "bar1", @Constructor = false, @DefiningType = "Foo", @Image = "bar1", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -30,15 +30,15 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "b", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "c1", @InputParametersSize = 0, @MethodName = "c1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | +- CastExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "b1", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a1", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- Method[@Arity = 2, @CanonicalName = "bar2", @Constructor = false, @DefiningType = "Foo", @Image = "bar2", @RealLoc = true, @ReturnType = "void", @StaticInitializer = false] @@ -50,9 +50,9 @@ | +- BlockStatement[@CurlyBrace = true, @DefiningType = "Foo", @RealLoc = true] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = true] | | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -60,9 +60,9 @@ | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] | +- ExpressionStatement[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "aField", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | +- MethodCallExpression[@DefiningType = "Foo", @FullMethodName = "aMethod", @InputParametersSize = 0, @MethodName = "aMethod", @RealLoc = true] - | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] + | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.METHOD, @SObjectType = false, @SafeNav = false] | +- ArrayLoadExpression[@DefiningType = "Foo", @RealLoc = true] | +- VariableExpression[@DefiningType = "Foo", @Image = "a", @RealLoc = true] | | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] @@ -77,14 +77,14 @@ | +- ModifierNode[@Abstract = false, @DefiningType = "Foo", @DeprecatedTestMethod = false, @Final = false, @Global = false, @InheritedSharing = false, @Modifiers = 0, @Override = false, @Private = false, @Protected = false, @Public = false, @RealLoc = false, @Static = false, @Test = false, @TestOrTestSetup = false, @Transient = false, @Virtual = false, @WebService = false, @WithSharing = false, @WithoutSharing = false] | +- VariableDeclaration[@DefiningType = "Foo", @Image = "s", @RealLoc = true, @Type = "String"] | +- VariableExpression[@DefiningType = "Foo", @Image = "BillingCity", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] | | +- VariableExpression[@DefiningType = "Foo", @Image = "Account", @RealLoc = true] - | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @Names = ("contact"), @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] + | | +- ReferenceExpression[@DefiningType = "Foo", @Image = "contact", @RealLoc = true, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = false] | +- VariableExpression[@DefiningType = "Foo", @Image = "s", @RealLoc = true] | +- EmptyReferenceExpression[@DefiningType = null, @RealLoc = false] +- ReturnStatement[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "Name", @RealLoc = true] - +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @Names = (), @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] + +- ReferenceExpression[@DefiningType = "Foo", @Image = "", @RealLoc = false, @ReferenceType = ReferenceType.LOAD, @SObjectType = false, @SafeNav = true] +- SoqlExpression[@CanonicalQuery = "SELECT Name FROM Account WHERE Id = :tmpVar1", @DefiningType = "Foo", @Query = "SELECT Name FROM Account WHERE Id = :accId", @RealLoc = true] +- BindExpressions[@DefiningType = "Foo", @RealLoc = true] +- VariableExpression[@DefiningType = "Foo", @Image = "accId", @RealLoc = true] From 56f12d41ea2fc86181fa031db7cc400d36efe3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:19:32 -0300 Subject: [PATCH 026/121] Update docs/pages/release_notes.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clรฉment Fournier --- docs/pages/release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index ab2d0ab991..3d9784465e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -21,7 +21,7 @@ Up to now, all AST node getters would be exposed to XPath, as long as the return Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` that implements `Queueable`, it is now possible to write: ```xml -/UserClass[not(empty(index-of(@InterfaceNames, 'Queueable')))] +/UserClass[@InterfaceNames = 'Queueable'] ``` ### โœจ New rules From 11e6cc53c54867329d2a03db66201f14bdfe9984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:23:56 -0300 Subject: [PATCH 027/121] Update docs on writing xpath rules --- .../userdocs/extending/writing_xpath_rules.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/pages/pmd/userdocs/extending/writing_xpath_rules.md b/docs/pages/pmd/userdocs/extending/writing_xpath_rules.md index 6518dcdcbc..d2d0d1505b 100644 --- a/docs/pages/pmd/userdocs/extending/writing_xpath_rules.md +++ b/docs/pages/pmd/userdocs/extending/writing_xpath_rules.md @@ -49,23 +49,21 @@ To represent attributes, we must map Java values to [XPath Data Model (XDM)](htt values. In the following table we refer to the type conversion function as `conv`, a function from Java types to XDM types. -| Java type `T` | XSD type `conv(T)` | -|---------------|---------------------------------------| -| `int` | `xs:integer` | -| `long` | `xs:integer` | -| `double` | `xs:decimal` | -| `float` | `xs:decimal` | -| `boolean` | `xs:boolean` | -| `String` | `xs:string` | -| `Character` | `xs:string` | -| `Enum` | `xs:string` (uses `Object::toString`) | -| `List` | `conv(E)*` (a sequence type) | +| Java type `T` | XSD type `conv(T)` | +|-------------------|---------------------------------------| +| `int` | `xs:integer` | +| `long` | `xs:integer` | +| `double` | `xs:decimal` | +| `float` | `xs:decimal` | +| `boolean` | `xs:boolean` | +| `String` | `xs:string` | +| `Character` | `xs:string` | +| `Enum` | `xs:string` (uses `Object::toString`) | +| `Collection` | `conv(E)*` (a sequence type) | The same `conv` function is used to translate rule property values to XDM values. -{% include warning.html content="Lists are only supported for rule properties, not attributes." %} - - +Additionaly, PMD's own `net.sourceforge.pmd.lang.document.Chars` is also translated to a `xs:string` ## Rule properties From 124f908ca8dbfc5755943107fe6657a2d0aaed33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:36:57 -0300 Subject: [PATCH 028/121] Properly log when the impossible happens --- .../pmd/lang/rule/xpath/impl/AttributeAxisIterator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 4337f25a13..01c1642aa7 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -132,8 +132,8 @@ public class AttributeAxisIterator implements Iterator { try { Class elementKlass = Class.forName(((ParameterizedType) t).getActualTypeArguments()[0].getTypeName()); return CONSIDERED_RETURN_TYPES.contains(elementKlass) || elementKlass.isEnum(); - } catch (ClassNotFoundException ignored) { - // should never happen + } catch (ClassNotFoundException e) { + throw AssertionUtil.shouldNotReachHere("Method '" + method + "' should return a known type, but: " + e, e); } } } From fbb4648efc5340d22a2d080b13694b446ecb9942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:37:42 -0300 Subject: [PATCH 029/121] Update pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Clรฉment Fournier --- .../pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java | 1 + 1 file changed, 1 insertion(+) 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 d854f4e9d6..083a2ec9d3 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 @@ -264,6 +264,7 @@ public class SaxonXPathRuleQuery { StaticContextWithProperties(Configuration config) { super(config); + // This statement is necessary for Saxon to support sequence-valued attributes getPackageData().setSchemaAware(true); } From 458405e02d575786cd66fa6c939158c37d48bb09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 12:43:30 -0300 Subject: [PATCH 030/121] Use spaces --- .../pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 083a2ec9d3..4ebf18c108 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 @@ -264,7 +264,7 @@ public class SaxonXPathRuleQuery { StaticContextWithProperties(Configuration config) { super(config); - // This statement is necessary for Saxon to support sequence-valued attributes + // This statement is necessary for Saxon to support sequence-valued attributes getPackageData().setSchemaAware(true); } From 4bb533b6254df09c640b8b66e8a34a4b1fbc4655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Sun, 28 Apr 2024 13:13:29 -0300 Subject: [PATCH 031/121] Ignore type variables --- .../pmd/lang/rule/xpath/impl/AttributeAxisIterator.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java index 01c1642aa7..001e32572c 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/impl/AttributeAxisIterator.java @@ -15,6 +15,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; @@ -130,8 +131,12 @@ public class AttributeAxisIterator implements Iterator { Type t = method.getGenericReturnType(); if (t instanceof ParameterizedType) { try { - Class elementKlass = Class.forName(((ParameterizedType) t).getActualTypeArguments()[0].getTypeName()); - return CONSIDERED_RETURN_TYPES.contains(elementKlass) || elementKlass.isEnum(); + // ignore type variables, such as Listโ€ฆ we could check all bounds, but probably it's overkill + Type actualTypeArgument = ((ParameterizedType) t).getActualTypeArguments()[0]; + if (!TypeVariable.class.isAssignableFrom(actualTypeArgument.getClass())) { + Class elementKlass = Class.forName(actualTypeArgument.getTypeName()); + return CONSIDERED_RETURN_TYPES.contains(elementKlass) || elementKlass.isEnum(); + } } catch (ClassNotFoundException e) { throw AssertionUtil.shouldNotReachHere("Method '" + method + "' should return a known type, but: " + e, e); } From 8c708b2193b8d34ae09e1d1ddb401d7f7275c2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 29 Apr 2024 20:35:48 +0200 Subject: [PATCH 032/121] Check upper bound compatibility during incorporation --- .../internal/infer/IncorporationAction.java | 66 ++++++++++++++++++- .../lang/java/types/internal/infer/Infer.java | 7 +- .../internal/infer/InferenceContext.java | 4 ++ .../types/internal/infer/InferenceVar.java | 2 +- .../internal/infer/PolyResolutionTest.kt | 3 - 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java index 1224569c13..ab467fcce5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java @@ -9,6 +9,8 @@ import static net.sourceforge.pmd.lang.java.types.TypeOps.isConvertible; import java.util.ArrayList; import java.util.Set; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; +import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; import net.sourceforge.pmd.lang.java.types.InternalApiBridge; import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.TypeOps.Convertibility; @@ -36,6 +38,66 @@ abstract class IncorporationAction { abstract void apply(InferenceContext ctx); + /** + * Check that an upper bound with a class (not interface) or array + * is compatible with other upper bounds of class or array type. + * This is necessary to guarantee the existence of a glb for these, + * for {@link ReductionStep#UPPER}. + * + *

If the bound is {@code alpha <: T}, then we must check + * that {@code S <: T} or {@code T <: S} holds for all bounds + * {@code alpha <: S}, where S is a class or array type. Otherwise, + * the GLB does not exist. + */ + static class CheckClassUpperBound extends IncorporationAction { + + private final JTypeMirror myBound; + + CheckClassUpperBound(InferenceVar ivar, JTypeMirror bound) { + super(ivar); + this.myBound = bound; + } + + public static boolean needsCheck(BoundKind kind, JTypeMirror bound) { + if (kind == BoundKind.UPPER) { + JTypeDeclSymbol symbol = bound.getSymbol(); + return symbol instanceof JClassSymbol && !symbol.isInterface(); + } + return false; + } + + + @Override + public void apply(InferenceContext ctx) { + for (BoundKind k : BoundKind.EQ_UPPER) { + for (JTypeMirror b : ivar.getBounds(k)) { + if (!checkBound(b, ctx)) { + throw ResolutionFailedException.incompatibleBound(ctx.logger, ivar, BoundKind.UPPER, myBound, k, b); + } + } + } + } + + private boolean checkBound(JTypeMirror otherBound, InferenceContext ctx) { + + JTypeDeclSymbol sym = otherBound.getSymbol(); + // either the bound is not a concrete class or array type + return !(sym instanceof JClassSymbol) || sym.isInterface() + // or both bounds are related in some way + || CheckBound.checkBound(false, otherBound, myBound, ctx) + || CheckBound.checkBound(false, myBound, otherBound, ctx); + + } + + + @Override + public String toString() { + return "Check class bound " + BoundKind.UPPER.format(ivar, myBound); + } + + + } + /** * Check that a bound is compatible with the other current bounds * of an ivar. @@ -97,13 +159,13 @@ abstract class IncorporationAction { /** * If 'eq', checks that {@code T = S}, else checks that {@code T <: S}. */ - boolean checkBound(boolean eq, JTypeMirror t, JTypeMirror s, InferenceContext ctx) { + static boolean checkBound(boolean eq, JTypeMirror t, JTypeMirror s, InferenceContext ctx) { // eq bounds are so rare we shouldn't care if they're cached return eq ? InternalApiBridge.isSameTypeInInference(t, s) : checkSubtype(t, s, ctx); } - private boolean checkSubtype(JTypeMirror t, JTypeMirror s, InferenceContext ctx) { + private static boolean checkSubtype(JTypeMirror t, JTypeMirror s, InferenceContext ctx) { if (ctx.getSupertypeCheckCache().isCertainlyASubtype(t, s)) { return true; // supertype was already cached } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java index 6de215c6d2..595bf77921 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/Infer.java @@ -577,12 +577,7 @@ public final class Infer { // we only test it can reduce, we don't commit inferred types at this stage InferenceContext ctxCopy = infCtx.copy(); LOG.applicabilityTest(ctxCopy, m); - try { - ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); - } catch (Exception e) { - // applicability test failed for this candidate, but continue with others - throw ResolutionFailedException.fromException(LOG, e); - } + ctxCopy.solve(/*onlyBoundedVars:*/isPreJava8()); // if unchecked conversion was needed, update the site for invocation pass if (ctxCopy.needsUncheckedConversion()) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java index 4a979dec0e..12698d1d5c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java @@ -33,6 +33,7 @@ import net.sourceforge.pmd.lang.java.types.TypeOps; import net.sourceforge.pmd.lang.java.types.TypeSystem; import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.InvocationMirror.MethodCtDecl; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.CheckBound; +import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.CheckClassUpperBound; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.PropagateAllBounds; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.PropagateBounds; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.SubstituteInst; @@ -388,6 +389,9 @@ final class InferenceContext { incorporationActions.add(new CheckBound(ivar, kind, bound)); incorporationActions.add(new PropagateBounds(ivar, kind, bound)); + if (CheckClassUpperBound.needsCheck(kind, bound)) { + incorporationActions.add(new CheckClassUpperBound(ivar, bound)); + } } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java index dafbd5f4b1..c36c10a74e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java @@ -304,7 +304,7 @@ public final class InferenceVar implements JTypeMirror, SubstVar { // These sets are shared because otherwise *literal millions* of enumsets are created, with the same constants static final Set ALL = EnumSet.allOf(BoundKind.class); static final Set EQ_LOWER = EnumSet.of(EQ, LOWER); - private static final Set EQ_UPPER = EnumSet.of(EQ, UPPER); + static final Set EQ_UPPER = EnumSet.of(EQ, UPPER); private static final Set JUST_EQ = Collections.singleton(EQ); private final String sym; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 17d131376a..c8cd940c47 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -15,9 +15,6 @@ import java.io.OutputStream /** * Expensive test cases for the overload resolution phase. - * - * Edit: So those used to be very expensive (think minutes of execution), - * but optimisations made them very fast. */ class PolyResolutionTest : ProcessorTestSpec({ From 6700b47b12e5e8196f675cd777e17c6cc01a8b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Mon, 29 Apr 2024 16:03:14 -0300 Subject: [PATCH 033/121] Remove unused code --- .../internal/infer/ResolutionFailedException.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java index 4ea2c0aa97..b955129c56 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ResolutionFailedException.java @@ -55,17 +55,6 @@ final class ResolutionFailedException extends RuntimeException { // If the logger is noop we don't even create the failure. // These failures are extremely frequent (and normal), and type pretty-printing is expensive - static ResolutionFailedException fromException(TypeInferenceLogger logger, Exception e) { - if (e instanceof ResolutionFailedException) { - return (ResolutionFailedException) e; - } - - return getShared(logger.isNoop() ? UNKNOWN : new ResolutionFailure( - null, - e.getMessage() - )); - } - static ResolutionFailedException incompatibleBound(TypeInferenceLogger logger, InferenceVar ivar, BoundKind k1, JTypeMirror b1, BoundKind k2, JTypeMirror b2) { // in javac it's "no instance of type variables exist ..." return getShared(logger.isNoop() ? UNKNOWN : new ResolutionFailure( From b1aaf5d69bbfe2ee7309f676d2309a6883fda6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 30 Apr 2024 11:21:15 +0200 Subject: [PATCH 034/121] Fix conc mod exceptions during incorporation --- .../pmd/lang/java/types/TypeOps.java | 84 ++++++++++--------- .../internal/infer/IncorporationAction.java | 84 ++++++------------- .../internal/infer/InferenceContext.java | 4 - .../lang/java/types/TestUtilitiesForTypes.kt | 2 +- .../internal/infer/PolyResolutionTest.kt | 21 +++++ 5 files changed, 91 insertions(+), 104 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 56c563ddf0..c0c84e0ca0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -398,11 +398,17 @@ public final class TypeOps { public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { - return isConvertible(t, s, true); + return isConvertible(t, s, true, false); } + @Deprecated // unused public static Convertibility isConvertibleNoCapture(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { - return isConvertible(t, s, false); + return isConvertible(t, s, false, false); + } + + // does not perform side effects on inference vars + public static Convertibility isConvertiblePure(JTypeMirror t, JTypeMirror s) { + return isConvertible(t, s, true, true); } /** @@ -414,7 +420,7 @@ public final class TypeOps { * @param t A type T * @param s A type S */ - public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s, boolean capture) { + public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s, boolean capture, boolean pure) { // This is commented out as it makes JTypeMirror#isSubtypeOf partial, // which is not nice for the API... But this assert caught a bug and // should probably be enabled. @@ -428,15 +434,17 @@ public final class TypeOps { } else if (s.isVoid() || t.isVoid()) { // t != s return Convertibility.NEVER; } else if (s instanceof InferenceVar) { - // it's possible to add a bound to UNKNOWN or ERROR - ((InferenceVar) s).addBound(BoundKind.LOWER, t); + if (!pure) { + // it's possible to add a bound to UNKNOWN or ERROR + ((InferenceVar) s).addBound(BoundKind.LOWER, t); + } return Convertibility.SUBTYPING; } else if (isTypeRange(s)) { // If s is a type range L..U, // then showing t <: s is the same thing as t <: L JTypeMirror lower = lowerBoundRec(s); if (!lower.isBottom()) { - return isConvertible(t, lower, capture); + return isConvertible(t, lower, capture, pure); } // otherwise fallthrough } else if (isSpecialUnresolved(t)) { @@ -447,7 +455,7 @@ public final class TypeOps { // subtypes of (nearly) anything. This allows them to // pass bound checks on type variables. if (Objects.equals(t.getSymbol(), s.getSymbol())) { - return typeArgsAreContained((JClassType) t, (JClassType) s); + return typeArgsAreContained((JClassType) t, (JClassType) s, pure); } else { return Convertibility.subtypeIf(s instanceof JClassType); // excludes array or so } @@ -455,24 +463,14 @@ public final class TypeOps { // If S is an intersection, then T must conform to *all* bounds of S // Symmetrically, if T is an intersection, T <: S requires only that // at least one bound of T is a subtype of S. - return Convertibility.subtypesAll(t, asList(s)); + return Convertibility.subtypesAll(t, asList(s), pure); } if (capture) { t = capture(t); } - return t.acceptVisitor(SubtypeVisitor.INSTANCE, s); - } - - // does not perform side effects on inference vars - private static Convertibility isSubtypePure(JTypeMirror t, JTypeMirror s) { - if (t instanceof InferenceVar) { - return Convertibility.subtypeIf(((InferenceVar) t).isSubtypeNoSideEffect(s)); - } else if (s instanceof InferenceVar) { - return Convertibility.subtypeIf(((InferenceVar) s).isSupertypeNoSideEffect(t)); - } - - return isConvertible(t, s); + SubtypeVisitor visitor = pure ? SubtypeVisitor.PURE : SubtypeVisitor.INSTANCE; + return t.acceptVisitor(visitor, s); } public static boolean allArgsAreUnboundedWildcards(List sargs) { @@ -601,10 +599,10 @@ public final class TypeOps { return b ? SUBTYPING : NEVER; } - static Convertibility subtypesAll(JTypeMirror t, Iterable supers) { + static Convertibility subtypesAll(JTypeMirror t, Iterable supers, boolean pure) { Convertibility result = SUBTYPING; for (JTypeMirror ui : supers) { - Convertibility sub = isConvertible(t, ui); + Convertibility sub = isConvertible(t, ui, true, pure); if (sub == NEVER) { return NEVER; } @@ -613,10 +611,10 @@ public final class TypeOps { return result; } - static Convertibility anySubTypesAny(Iterable us, Iterable vs) { + static Convertibility anySubTypesAny(Iterable us, Iterable vs, boolean pure) { for (JTypeMirror ui : us) { for (JTypeMirror vi : vs) { - Convertibility sub = isConvertible(ui, vi); + Convertibility sub = isConvertible(ui, vi, true, pure); if (sub != NEVER) { return sub.and(SUBTYPING); // never return identity here } @@ -680,7 +678,7 @@ public final class TypeOps { * *

Defined in JLSยง4.5.1 (Type Arguments of Parameterized Types) */ - static Convertibility typeArgContains(JTypeMirror s, JTypeMirror t) { + static Convertibility typeArgContains(JTypeMirror s, JTypeMirror t, boolean pure) { // the contains relation can be understood intuitively if we // represent types as ranges on a line: @@ -698,7 +696,7 @@ public final class TypeOps { // โŠฅ -------U(T)-----U(S)------> Object (L(T) = L(S) = โŠฅ) // โŠฅ -------L(S)-----L(T)------> Object (U(T) = U(S) = Object) - if (isSameTypeInInference(s, t)) { + if (isSameType(s, t, !pure, false)) { // S <= S return Convertibility.SUBTYPING; } @@ -714,10 +712,10 @@ public final class TypeOps { if (sw.isUpperBound()) { // Test U(T) <: U(S), we already know L(S) <: L(T), because L(S) is bottom - return isConvertible(wildUpperBound(t), sw.asUpperBound()); + return isConvertible(wildUpperBound(t), sw.asUpperBound(), pure, false); } else { // Test L(S) <: L(T), we already know U(T) <: U(S), because U(S) is top - return isConvertible(sw.asLowerBound(), wildLowerBound(t)); + return isConvertible(sw.asLowerBound(), wildLowerBound(t), pure, false); } } @@ -728,7 +726,7 @@ public final class TypeOps { /** * Generalises containment to check if for each i, {@code Ti <= Si}. */ - static Convertibility typeArgsAreContained(JClassType t, JClassType s) { + static Convertibility typeArgsAreContained(JClassType t, JClassType s, boolean pure) { List targs = t.getTypeArgs(); List sargs = s.getTypeArgs(); @@ -763,7 +761,7 @@ public final class TypeOps { Convertibility result = Convertibility.SUBTYPING; for (int i = 0; i < targs.size(); i++) { - Convertibility sub = typeArgContains(sargs.get(i), targs.get(i)); + Convertibility sub = typeArgContains(sargs.get(i), targs.get(i), pure); if (sub == Convertibility.NEVER) { return Convertibility.NEVER; } @@ -775,7 +773,13 @@ public final class TypeOps { private static final class SubtypeVisitor implements JTypeVisitor { - static final SubtypeVisitor INSTANCE = new SubtypeVisitor(); + static final SubtypeVisitor INSTANCE = new SubtypeVisitor(false); + static final SubtypeVisitor PURE = new SubtypeVisitor(true); + private final boolean pure; + + private SubtypeVisitor(boolean pure) { + this.pure = pure; + } @Override public Convertibility visit(JTypeMirror t, JTypeMirror s) { @@ -788,9 +792,9 @@ public final class TypeOps { return Convertibility.SUBTYPING; } if (isTypeRange(s)) { - return isConvertible(t, lowerBoundRec(s)); + return isConvertible(t, lowerBoundRec(s), true, pure); } - return isConvertible(t.getUpperBound(), s); + return isConvertible(t.getUpperBound(), s, true, pure); } @Override @@ -810,8 +814,10 @@ public final class TypeOps { if (s == t.getTypeSystem().NULL_TYPE || s instanceof JPrimitiveType) { return Convertibility.NEVER; } - // here we add a constraint on the variable - t.addBound(BoundKind.UPPER, s); + if (!pure) { + // here we add a constraint on the variable + t.addBound(BoundKind.UPPER, s); + } return Convertibility.SUBTYPING; } @@ -840,7 +846,7 @@ public final class TypeOps { // a raw type C is a supertype for all the family of parameterized type generated by C return Convertibility.SUBTYPING; } else { - return typeArgsAreContained(superDecl, cs); + return typeArgsAreContained(superDecl, cs, pure); } } @@ -864,7 +870,7 @@ public final class TypeOps { // what we mean is, if S is an intersection, then // "any component of T subtypes any component of S" - return Convertibility.anySubTypesAny(t.getComponents(), asList(s)); + return Convertibility.anySubTypesAny(t.getComponents(), asList(s), pure); } @Override @@ -885,7 +891,7 @@ public final class TypeOps { // arrays of primitive types have no sub-/ supertype return Convertibility.subtypeIf(cs.getComponentType() == t.getComponentType()); } else { - return isConvertible(t.getComponentType(), cs.getComponentType()); + return isConvertible(t.getComponentType(), cs.getComponentType(), true, pure); } } @@ -1739,7 +1745,7 @@ public final class TypeOps { for (JTypeMirror v : set) { for (JTypeMirror w : set) { if (!w.equals(v) && !hasUnresolvedSymbol(w)) { - Convertibility isConvertible = isSubtypePure(w, v); + Convertibility isConvertible = isConvertiblePure(w, v); if (isConvertible.bySubtyping() // This last case covers unchecked conversion. It is made antisymmetric by the // test for a symbol. eg |G| <~> G so it would fail. diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java index ab467fcce5..dfda211282 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java @@ -13,6 +13,7 @@ import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; import net.sourceforge.pmd.lang.java.types.InternalApiBridge; import net.sourceforge.pmd.lang.java.types.JTypeMirror; +import net.sourceforge.pmd.lang.java.types.TypeOps; import net.sourceforge.pmd.lang.java.types.TypeOps.Convertibility; import net.sourceforge.pmd.lang.java.types.internal.infer.InferenceVar.BoundKind; @@ -38,66 +39,6 @@ abstract class IncorporationAction { abstract void apply(InferenceContext ctx); - /** - * Check that an upper bound with a class (not interface) or array - * is compatible with other upper bounds of class or array type. - * This is necessary to guarantee the existence of a glb for these, - * for {@link ReductionStep#UPPER}. - * - *

If the bound is {@code alpha <: T}, then we must check - * that {@code S <: T} or {@code T <: S} holds for all bounds - * {@code alpha <: S}, where S is a class or array type. Otherwise, - * the GLB does not exist. - */ - static class CheckClassUpperBound extends IncorporationAction { - - private final JTypeMirror myBound; - - CheckClassUpperBound(InferenceVar ivar, JTypeMirror bound) { - super(ivar); - this.myBound = bound; - } - - public static boolean needsCheck(BoundKind kind, JTypeMirror bound) { - if (kind == BoundKind.UPPER) { - JTypeDeclSymbol symbol = bound.getSymbol(); - return symbol instanceof JClassSymbol && !symbol.isInterface(); - } - return false; - } - - - @Override - public void apply(InferenceContext ctx) { - for (BoundKind k : BoundKind.EQ_UPPER) { - for (JTypeMirror b : ivar.getBounds(k)) { - if (!checkBound(b, ctx)) { - throw ResolutionFailedException.incompatibleBound(ctx.logger, ivar, BoundKind.UPPER, myBound, k, b); - } - } - } - } - - private boolean checkBound(JTypeMirror otherBound, InferenceContext ctx) { - - JTypeDeclSymbol sym = otherBound.getSymbol(); - // either the bound is not a concrete class or array type - return !(sym instanceof JClassSymbol) || sym.isInterface() - // or both bounds are related in some way - || CheckBound.checkBound(false, otherBound, myBound, ctx) - || CheckBound.checkBound(false, myBound, otherBound, ctx); - - } - - - @Override - public String toString() { - return "Check class bound " + BoundKind.UPPER.format(ivar, myBound); - } - - - } - /** * Check that a bound is compatible with the other current bounds * of an ivar. @@ -113,6 +54,11 @@ abstract class IncorporationAction { this.myBound = bound; } + public static boolean isClassType(JTypeMirror bound) { + JTypeDeclSymbol symbol = bound.getSymbol(); + return symbol instanceof JClassSymbol && !symbol.isInterface(); + } + /** * The list of bound kinds to be checked. If the new bound is * equality, then all other bounds need to be checked. Otherwise, @@ -132,8 +78,26 @@ abstract class IncorporationAction { } } } + + if (myKind == BoundKind.UPPER && isClassType(myBound)) { + // Check that other upper bounds that are class types are related to this bound. + // Otherwise, GLB does not exist and its construction would fail during ReductionStep#UPPER. + for (JTypeMirror otherBound : ivar.getBounds(BoundKind.UPPER)) { + if (otherBound != myBound && isClassType(otherBound)) { + // Since we are testing both directions we cannot let those tests add bounds on the ivars, + // because they could be contradictory. + boolean areRelated = TypeOps.isConvertiblePure(myBound, otherBound).somehow() + || TypeOps.isConvertiblePure(otherBound, myBound).somehow(); + + if (!areRelated) { + throw ResolutionFailedException.incompatibleBound(ctx.logger, ivar, myKind, myBound, BoundKind.UPPER, otherBound); + } + } + } + } } + /** * Check compatibility between this bound and another. */ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java index 12698d1d5c..4a979dec0e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceContext.java @@ -33,7 +33,6 @@ import net.sourceforge.pmd.lang.java.types.TypeOps; import net.sourceforge.pmd.lang.java.types.TypeSystem; import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.InvocationMirror.MethodCtDecl; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.CheckBound; -import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.CheckClassUpperBound; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.PropagateAllBounds; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.PropagateBounds; import net.sourceforge.pmd.lang.java.types.internal.infer.IncorporationAction.SubstituteInst; @@ -389,9 +388,6 @@ final class InferenceContext { incorporationActions.add(new CheckBound(ivar, kind, bound)); incorporationActions.add(new PropagateBounds(ivar, kind, bound)); - if (CheckClassUpperBound.needsCheck(kind, bound)) { - incorporationActions.add(new CheckClassUpperBound(ivar, bound)); - } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt index af662f19e1..2cd3888ae8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt @@ -168,7 +168,7 @@ fun assertSubtypeOrdering(vararg ts: JTypeMirror) { fun JClassType.parameterize(m1: JTypeMirror, vararg mirror: JTypeMirror): JClassType = withTypeArguments(listOf(m1, *mirror)) fun assertSubtype(t: JTypeMirror, s: JTypeMirror, capture: Boolean = true, passes: Convertibility.() -> Boolean) { - val res = isConvertible(t, s, capture) + val res = isConvertible(t, s, capture, true) assertTrue("$t \n\t\t<: $s") { res.passes() } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index c8cd940c47..cfdc9d9f1d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -392,4 +392,25 @@ class Scratch { call shouldHaveType gen.`t_Stream{Number}` } } + + parserTest("Test bound checks does not throw concurrent mod exception") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + import java.util.stream.Stream; + class Enum> {} + class EnumSet> { + public static > EnumSet noneOf(Class elementType) { + Enum[] universe = getUniverse(elementType); + } + private static > U[] getUniverse(Class elementType) {} + } + """) + + val call = acu.firstMethodCall() + val xVar = acu.typeVar("X") + + spy.shouldBeOk { + call shouldHaveType xVar.toArray() + } + } }) From 895cfbf266e11e37d4832f6d80a4f97730f88547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 2 May 2024 13:05:04 -0300 Subject: [PATCH 035/121] Update docs/pages/release_notes.md Co-authored-by: Andreas Dangel --- docs/pages/release_notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 31376368ca..48fcdb3745 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -18,7 +18,7 @@ This is a {{ site.pmd.release_type }} release. Up to now, all AST node getters would be exposed to XPath, as long as the return type was a primitive (boxed or unboxed), String or Enum. That meant that collections, even of these basic types, were not exposed, so for instance accessing Apex's `ASTUserClass.getInterfaceNames()` to list the interfaces implemented by a class was impossible from XPath, and would require writing a Java rule to check it. -Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` that implements `Queueable`, it is now possible to write: +Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` in Apex that implements `Queueable`, it is now possible to write: ```xml /UserClass[@InterfaceNames = 'Queueable'] From 6fd230e7aa69378f7a784d788c0529c683b3c292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 2 May 2024 13:05:17 -0300 Subject: [PATCH 036/121] Update docs/pages/release_notes.md Co-authored-by: Andreas Dangel --- docs/pages/release_notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 48fcdb3745..e3a92cbf6b 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -25,7 +25,8 @@ Since this release, PMD will also expose any getter returning a collection of an ``` ### ๐Ÿ› Fixed Issues - +* core + * [#4467](https://github.com/pmd/pmd/issues/4467): \[core] Expose collections from getters as XPath sequence attributes * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test From 199591bbd81056d440ade3f5bbbf2e6c8476d4ed Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 May 2024 19:47:22 +0200 Subject: [PATCH 037/121] [doc] Update about PMD sections Refs #4842 --- README.md | 22 ++++++++++------------ docs/index.md | 20 +++++++++++++++----- pom.xml | 18 ++++++++++-------- 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 43c3df58a1..f0749994fa 100644 --- a/README.md +++ b/README.md @@ -11,22 +11,20 @@ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md) [![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/) -**PMD** is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, -unnecessary object creation, and so forth. It supports many languages. It can be extended with custom rules. -It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. -Rules can be written in Java or using a XPath query. +**PMD** is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, +empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with **Java and +Apex**, but **supports 16 other languages**. It comes with **400+ built-in rules**. It can be +extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees +(AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query. -It supports Java, JavaScript, Salesforce.com Apex and Visualforce, -Modelica, PLSQL, Apache Velocity, HTML, XML and XSL. +Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, +Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available. Additionally, it includes **CPD**, the copy-paste-detector. CPD finds duplicated code in -C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Kotlin, Lua, Matlab, Modelica, -Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL, -Apache Velocity, and XML. - -In the future we hope to add support for data/control flow analysis and automatic (quick) fixes where -it makes sense. +Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, +Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and +Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL. ## ๐Ÿš€ Installation and Usage diff --git a/docs/index.md b/docs/index.md index 2a9eb9fed0..3bafc43f4d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -24,10 +24,20 @@ additional_js: -**PMD** is a static source code analyzer. It finds common programming flaws like -unused variables, empty catch blocks, unnecessary object creation, and -so forth. It's mainly concerned with **Java and Apex**, but **supports 16 other -languages**. +**PMD** is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, +empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with **Java and +Apex**, but **supports 16 other languages**. It comes with **400+ built-in rules**. It can be +extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees +(AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query. + +Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, +Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. +Scala is supported, but there are currently no Scala rules available. + +Additionally, it includes **CPD**, the copy-paste-detector. CPD finds duplicated code in +Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, +Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and +Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL. PMD features many **built-in checks** (in PMD lingo, *rules*), which are documented for each language in our [Rule references](#shuffle-panel-rule-references). We @@ -43,7 +53,7 @@ things, PMD can be run: * As a [bld operation](pmd_userdocs_tools_bld.html) * From [command-line](pmd_userdocs_installation.html#running-pmd-via-command-line) -**CPD**, the **copy-paste detector**, is also distributed with PMD. You can also use it +**CPD**, the **copy-paste detector**, is also distributed with PMD. You can use it in a variety of ways, which are [documented here](pmd_userdocs_cpd.html). ## ๐Ÿ’พ Download diff --git a/pom.xml b/pom.xml index 11d7bef738..f3bab7a3e4 100644 --- a/pom.xml +++ b/pom.xml @@ -8,18 +8,20 @@ PMD - PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, - unnecessary object creation, and so forth. It supports many languages. It can be extended with custom rules. - It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations. - Rules can be written in Java or using a XPath query. + PMD is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables, + empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with Java and + Apex, but supports 16 other languages. It comes with 400+ built-in rules. It can be + extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees + (AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query. - It supports Java, JavaScript, Salesforce.com Apex and Visualforce, - Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, HTML, XML and XSL. + Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce, + Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL. Scala is supported, but there are currently no Scala rules available. Additionally, it includes CPD, the copy-paste-detector. CPD finds duplicated code in - Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, Lua, Matlab, Modelica, - Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL, Typescript and XML. + Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin, + Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and + Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL. https://pmd.github.io/ From 516b305e502d075ce3c3f4d5a12977606934ed0a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 May 2024 19:57:57 +0200 Subject: [PATCH 038/121] [doc] Fix links in README.md [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f0749994fa..a08c66d76c 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ [![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=master)](https://github.com/pmd/pmd/actions) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd) -[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central#net.sourceforge.pmd:pmd) +[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme) [![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://www.codacy.com/gh/pmd/pmd/dashboard?utm_source=github.com&utm_medium=referral&utm_content=pmd/pmd&utm_campaign=Badge_Grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://app.codacy.com/organizations/gh/pmd/dashboard) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md) [![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/) From ef19659cb67ed087878c1d860df7b009c82855d5 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 3 May 2024 20:26:05 +0200 Subject: [PATCH 039/121] [ci] Only run PMD twice instead of three times during build pmd:check executes implicitly pmd:pmd, but with the default configuration. For execution "pmd-test" this means, we called pmd:pmd twice: Once within "pmd-test" to check test code and once more via pmd:check, but against the main code. Skipping now the default configuration always and explicitly call pmd:pmd in the two executions. Thanks @uhafner for the idea. --- pom.xml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index f3bab7a3e4..e5b7e66827 100644 --- a/pom.xml +++ b/pom.xml @@ -506,9 +506,22 @@ pmd-main verify + pmd check + cpd cpd-check + + ${pmd.skip} + 100 + + /net/sourceforge/pmd/pmd-dogfood-config.xml + + + target/generated-sources/javacc + target/generated-sources/antlr4 + + pmd-test @@ -518,6 +531,7 @@ check + ${pmd.skip} ${project.build.directory}/pmdTest/ true @@ -528,19 +542,15 @@ false - 100 1.${java.version} - - /net/sourceforge/pmd/pmd-dogfood-config.xml - - - target/generated-sources/javacc - target/generated-sources/antlr4 - false 2 true true + + true From b2a1ef714fc8d8a36afef88c94a99e83a7dbe8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 6 May 2024 12:03:38 +0200 Subject: [PATCH 040/121] Fix PMD warning --- .../pmd/lang/java/types/internal/infer/IncorporationAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java index dfda211282..cc9bc4f9ec 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java @@ -83,7 +83,7 @@ abstract class IncorporationAction { // Check that other upper bounds that are class types are related to this bound. // Otherwise, GLB does not exist and its construction would fail during ReductionStep#UPPER. for (JTypeMirror otherBound : ivar.getBounds(BoundKind.UPPER)) { - if (otherBound != myBound && isClassType(otherBound)) { + if (otherBound != myBound && isClassType(otherBound)) { // NOPMD CompareObjectsWithEquals // Since we are testing both directions we cannot let those tests add bounds on the ivars, // because they could be contradictory. boolean areRelated = TypeOps.isConvertiblePure(myBound, otherBound).somehow() From 788b07ba14cd14204e936381e3b5286674eb5c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 6 May 2024 12:23:08 +0200 Subject: [PATCH 041/121] Move methods in order to avoid carrying around the pure parameter which is error-prone --- .../pmd/lang/java/types/TypeOps.java | 439 +++++++++--------- .../lang/java/types/TestUtilitiesForTypes.kt | 9 +- 2 files changed, 226 insertions(+), 222 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 0f8a12f38f..593ce994c9 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -79,7 +79,7 @@ public final class TypeOps { * of {@link JTypeMirror}. */ public static boolean isSameType(JTypeMirror t, JTypeMirror s) { - return isSameType(t, s, false, false); + return isSameType(t, s, true, false); } /** @@ -87,7 +87,7 @@ public final class TypeOps { * appearing within them. */ public static boolean isSameTypeWithSameAnnotations(JTypeMirror t, JTypeMirror s) { - return isSameType(t, s, false, true); + return isSameType(t, s, true, true); } /** @@ -97,7 +97,7 @@ public final class TypeOps { * @apiNote Internal API */ static boolean isSameTypeInInference(JTypeMirror t, JTypeMirror s) { - return isSameType(t, s, true, false); + return isSameType(t, s, false, false); } /** @@ -105,7 +105,7 @@ public final class TypeOps { * true, then encountering inference variables produces side effects * on them, adding bounds. */ - private static boolean isSameType(JTypeMirror t, JTypeMirror s, boolean inInference, boolean considerAnnotations) { + private static boolean isSameType(JTypeMirror t, JTypeMirror s, boolean pure, boolean considerAnnotations) { if (t == s) { // also returns true if both t and s are null return true; @@ -115,7 +115,7 @@ public final class TypeOps { return false; } - if (!inInference) { + if (pure) { if (considerAnnotations) { if (t instanceof CaptureMatcher || s instanceof CaptureMatcher) { return t.equals(s); // skip check for type annotations @@ -156,7 +156,7 @@ public final class TypeOps { return false; } for (int i = 0; i < ts.size(); i++) { - if (!isSameType(ts.get(i), ss.get(i).subst(subst), inInference, considerAnnotations)) { + if (!isSameType(ts.get(i), ss.get(i).subst(subst), !inInference, considerAnnotations)) { return false; } } @@ -195,7 +195,7 @@ public final class TypeOps { JClassType s2 = (JClassType) s; return t.getSymbol().equals(s2.getSymbol()) // maybe compare the type system as well. && t.hasErasedSuperTypes() == s2.hasErasedSuperTypes() - && isSameType(t.getEnclosingType(), s2.getEnclosingType(), inInference, considerAnnotations) + && isSameType(t.getEnclosingType(), s2.getEnclosingType(), !inInference, considerAnnotations) && areSameTypes(t.getTypeArgs(), s2.getTypeArgs(), inInference, considerAnnotations); } return false; @@ -212,7 +212,7 @@ public final class TypeOps { return false; } JWildcardType s2 = (JWildcardType) s; - return s2.isUpperBound() == t.isUpperBound() && isSameType(t.getBound(), s2.getBound(), inInference, considerAnnotations); + return s2.isUpperBound() == t.isUpperBound() && isSameType(t.getBound(), s2.getBound(), !inInference, considerAnnotations); } @Override @@ -254,7 +254,7 @@ public final class TypeOps { return false; } - if (!isSameType(t.getPrimaryBound(), s2.getPrimaryBound(), inInference, considerAnnotations)) { + if (!isSameType(t.getPrimaryBound(), s2.getPrimaryBound(), !inInference, considerAnnotations)) { return false; } @@ -263,7 +263,7 @@ public final class TypeOps { boolean found = false; for (JTypeMirror si : sComps) { // todo won't this behaves weirdly during inference? test it - if (isSameType(ti, si, inInference, considerAnnotations)) { + if (isSameType(ti, si, !inInference, considerAnnotations)) { found = true; break; } @@ -278,7 +278,7 @@ public final class TypeOps { @Override public Boolean visitArray(JArrayType t, JTypeMirror s) { return s instanceof JArrayType - && isSameType(t.getComponentType(), ((JArrayType) s).getComponentType(), inInference, considerAnnotations); + && isSameType(t.getComponentType(), ((JArrayType) s).getComponentType(), !inInference, considerAnnotations); } } @@ -398,84 +398,16 @@ public final class TypeOps { public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { - return isConvertible(t, s, true, false); + return SubtypeVisitor.INFERENCE.isConvertible(t, s); } - @Deprecated // unused public static Convertibility isConvertibleNoCapture(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { - return isConvertible(t, s, false, false); + return SubtypeVisitor.PURE.isConvertible(t, s, false); } // does not perform side effects on inference vars public static Convertibility isConvertiblePure(JTypeMirror t, JTypeMirror s) { - return isConvertible(t, s, true, true); - } - - /** - * Returns whether if {@code T <: S}, ie T is a subtype of S. - * - *

Note that {@link TypeSystem#ERROR} and {@link TypeSystem#UNKNOWN} - * are considered subtypes of anything. - * - * @param t A type T - * @param s A type S - */ - public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s, boolean capture, boolean pure) { - // This is commented out as it makes JTypeMirror#isSubtypeOf partial, - // which is not nice for the API... But this assert caught a bug and - // should probably be enabled. - // assert !(t instanceof JWildcardType || s instanceof JWildcardType) : "Wildcards do not support subtyping"; - - if (t == s) { - Objects.requireNonNull(t); - return Convertibility.SUBTYPING; - } else if (s.isTop()) { - return Convertibility.subtypeIf(!t.isPrimitive()); - } else if (s.isVoid() || t.isVoid()) { // t != s - return Convertibility.NEVER; - } else if (s instanceof InferenceVar) { - if (!pure) { - // it's possible to add a bound to UNKNOWN or ERROR - ((InferenceVar) s).addBound(BoundKind.LOWER, t); - } - return Convertibility.SUBTYPING; - } else if (isTypeRange(s)) { - // If s is a type range L..U, - // then showing t <: s is the same thing as t <: L - JTypeMirror lower = lowerBoundRec(s); - if (!lower.isBottom()) { - return isConvertible(t, lower, capture, pure); - } - // otherwise fallthrough - } else if (isSpecialUnresolved(t)) { - // error type or unresolved type is subtype of everything - if (s instanceof JArrayType) { - // In case the array has an ivar 'a as element type, a bound will be added 'a >: (*unknown*) - // This helps inference recover in call chains and propagate the (*unknown*) types gracefully. - return isConvertible(t, ((JArrayType) s).getElementType()); - } - return Convertibility.SUBTYPING; - } else if (hasUnresolvedSymbol(t) && t instanceof JClassType) { - // This also considers types with an unresolved symbol - // subtypes of (nearly) anything. This allows them to - // pass bound checks on type variables. - if (Objects.equals(t.getSymbol(), s.getSymbol())) { - return typeArgsAreContained((JClassType) t, (JClassType) s, pure); - } else { - return Convertibility.subtypeIf(s instanceof JClassType); // excludes array or so - } - } else if (s instanceof JIntersectionType) { // TODO test intersection with tvars & arrays - // If S is an intersection, then T must conform to *all* bounds of S - // Symmetrically, if T is an intersection, T <: S requires only that - // at least one bound of T is a subtype of S. - return Convertibility.subtypesAll(t, asList(s), pure); - } - - if (capture) { - t = capture(t); - } - SubtypeVisitor visitor = pure ? SubtypeVisitor.PURE : SubtypeVisitor.INSTANCE; - return t.acceptVisitor(visitor, s); + return SubtypeVisitor.PURE.isConvertible(t, s); } public static boolean allArgsAreUnboundedWildcards(List sargs) { @@ -604,29 +536,6 @@ public final class TypeOps { return b ? SUBTYPING : NEVER; } - static Convertibility subtypesAll(JTypeMirror t, Iterable supers, boolean pure) { - Convertibility result = SUBTYPING; - for (JTypeMirror ui : supers) { - Convertibility sub = isConvertible(t, ui, true, pure); - if (sub == NEVER) { - return NEVER; - } - result = result.and(sub); - } - return result; - } - - static Convertibility anySubTypesAny(Iterable us, Iterable vs, boolean pure) { - for (JTypeMirror ui : us) { - for (JTypeMirror vi : vs) { - Convertibility sub = isConvertible(ui, vi, true, pure); - if (sub != NEVER) { - return sub.and(SUBTYPING); // never return identity here - } - } - } - return NEVER; - } } private static JTypeMirror wildUpperBound(JTypeMirror type) { @@ -669,116 +578,9 @@ public final class TypeOps { } - /** - * Returns true if {@code T <= S}, ie "S contains T". - * - *

S contains T if: - * - *

{@code L(S) <: L(T) && U(T) <: U(S)} - * - *

This only makes sense for type arguments, it's a component of - * subtype checks for parameterized types: - * - *

{@code C <: C if S <= T} - * - *

Defined in JLSยง4.5.1 (Type Arguments of Parameterized Types) - */ - static Convertibility typeArgContains(JTypeMirror s, JTypeMirror t, boolean pure) { - // the contains relation can be understood intuitively if we - // represent types as ranges on a line: - - // โŠฅ ---------L(S)---L(T)------U(T)-----U(S)---> Object - // range of S [-------------------------] - // range of T [---------] - - // here S contains T because its range is greater - - // since a wildcard is either "super" or "extends", in reality - // either L(S) = โŠฅ, or U(S) = Object. - - // meaning when S != T, we only have two scenarios where T <= S: - - // โŠฅ -------U(T)-----U(S)------> Object (L(T) = L(S) = โŠฅ) - // โŠฅ -------L(S)-----L(T)------> Object (U(T) = U(S) = Object) - - if (isSameType(s, t, !pure, false)) { - // S <= S - return Convertibility.SUBTYPING; - } - - if (s instanceof JWildcardType) { - JWildcardType sw = (JWildcardType) s; - - // capt(? extends T) <= ? extends T - // capt(? super T) <= ? super T - if (t instanceof JTypeVar && ((JTypeVar) t).isCaptureOf(sw)) { - return Convertibility.SUBTYPING; - } - - if (sw.isUpperBound()) { - // Test U(T) <: U(S), we already know L(S) <: L(T), because L(S) is bottom - return isConvertible(wildUpperBound(t), sw.asUpperBound(), pure, false); - } else { - // Test L(S) <: L(T), we already know U(T) <: U(S), because U(S) is top - return isConvertible(sw.asLowerBound(), wildLowerBound(t), pure, false); - } - } - - return Convertibility.NEVER; - } - - - /** - * Generalises containment to check if for each i, {@code Ti <= Si}. - */ - static Convertibility typeArgsAreContained(JClassType t, JClassType s, boolean pure) { - List targs = t.getTypeArgs(); - List sargs = s.getTypeArgs(); - - if (targs.isEmpty()) { - if (sargs.isEmpty()) { - // Some "erased" non-generic types may appear as the supertypes - // of raw types, and they're different from the regular flavor - // as their own supertypes are erased, yet they're not considered - // raw. To fix the subtyping relation, we say that `C <: (erased) C` - // but `(erased) C` converts to `C` by unchecked conversion, without - // warning. - boolean tRaw = t.hasErasedSuperTypes(); - boolean sRaw = s.hasErasedSuperTypes(); - if (tRaw && !sRaw) { - return Convertibility.UNCHECKED_NO_WARNING; - } else { - return Convertibility.SUBTYPING; - } - } - // for some C, S = C<...> and T = C, ie T is raw - // T is convertible to S, by unchecked conversion. - // If S = D, then the conversion produces - // no unchecked warning. - return allArgsAreUnboundedWildcards(sargs) ? Convertibility.UNCHECKED_NO_WARNING - : Convertibility.UNCHECKED_WARNING; - } - - if (targs.size() != sargs.size()) { - // types are not well-formed - return Convertibility.NEVER; - } - - Convertibility result = Convertibility.SUBTYPING; - for (int i = 0; i < targs.size(); i++) { - Convertibility sub = typeArgContains(sargs.get(i), targs.get(i), pure); - if (sub == Convertibility.NEVER) { - return Convertibility.NEVER; - } - result = result.and(sub); - } - - return result; - } - private static final class SubtypeVisitor implements JTypeVisitor { - static final SubtypeVisitor INSTANCE = new SubtypeVisitor(false); + static final SubtypeVisitor INFERENCE = new SubtypeVisitor(false); static final SubtypeVisitor PURE = new SubtypeVisitor(true); private final boolean pure; @@ -786,6 +588,207 @@ public final class TypeOps { this.pure = pure; } + + Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { + return isConvertible(t, s, true); + } + + /** + * Returns whether if {@code T <: S}, ie T is a subtype of S. + * + *

Note that {@link TypeSystem#ERROR} and {@link TypeSystem#UNKNOWN} + * are considered subtypes of anything. + * + * @param t A type T + * @param s A type S + */ + Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s, boolean capture) { + // This is commented out as it makes JTypeMirror#isSubtypeOf partial, + // which is not nice for the API... But this assert caught a bug and + // should probably be enabled. + // assert !(t instanceof JWildcardType || s instanceof JWildcardType) : "Wildcards do not support subtyping"; + + if (t == s) { + Objects.requireNonNull(t); + return Convertibility.SUBTYPING; + } else if (s.isTop()) { + return Convertibility.subtypeIf(!t.isPrimitive()); + } else if (s.isVoid() || t.isVoid()) { // t != s + return Convertibility.NEVER; + } else if (s instanceof InferenceVar) { + if (!pure) { + // it's possible to add a bound to UNKNOWN or ERROR + ((InferenceVar) s).addBound(BoundKind.LOWER, t); + } + return Convertibility.SUBTYPING; + } else if (isTypeRange(s)) { + // If s is a type range L..U, + // then showing t <: s is the same thing as t <: L + JTypeMirror lower = lowerBoundRec(s); + if (!lower.isBottom()) { + return isConvertible(t, lower); + } + // otherwise fallthrough + } else if (isSpecialUnresolved(t)) { + // error type or unresolved type is subtype of everything + if (s instanceof JArrayType) { + // In case the array has an ivar 'a as element type, a bound will be added 'a >: (*unknown*) + // This helps inference recover in call chains and propagate the (*unknown*) types gracefully. + return TypeOps.isConvertible(t, ((JArrayType) s).getElementType()); + } + return Convertibility.SUBTYPING; + } else if (hasUnresolvedSymbol(t) && t instanceof JClassType) { + // This also considers types with an unresolved symbol + // subtypes of (nearly) anything. This allows them to + // pass bound checks on type variables. + if (Objects.equals(t.getSymbol(), s.getSymbol())) { + return typeArgsAreContained((JClassType) t, (JClassType) s); + } else { + return Convertibility.subtypeIf(s instanceof JClassType); // excludes array or so + } + } else if (s instanceof JIntersectionType) { // TODO test intersection with tvars & arrays + // If S is an intersection, then T must conform to *all* bounds of S + // Symmetrically, if T is an intersection, T <: S requires only that + // at least one bound of T is a subtype of S. + return subtypesAll(t, asList(s)); + } + + if (capture) { + t = capture(t); + } + return t.acceptVisitor(this, s); + } + + Convertibility subtypesAll(JTypeMirror t, Iterable supers) { + Convertibility result = Convertibility.SUBTYPING; + for (JTypeMirror ui : supers) { + Convertibility sub = isConvertible(t, ui); + if (sub == Convertibility.NEVER) { + return Convertibility.NEVER; + } + result = result.and(sub); + } + return result; + } + + Convertibility anySubTypesAny(Iterable us, Iterable vs) { + for (JTypeMirror ui : us) { + for (JTypeMirror vi : vs) { + Convertibility sub = isConvertible(ui, vi); + if (sub != Convertibility.NEVER) { + return sub.and(Convertibility.SUBTYPING); // never return identity here + } + } + } + return Convertibility.NEVER; + } + + /** + * Generalises containment to check if for each i, {@code Ti <= Si}. + */ + Convertibility typeArgsAreContained(JClassType t, JClassType s) { + List targs = t.getTypeArgs(); + List sargs = s.getTypeArgs(); + + if (targs.isEmpty()) { + if (sargs.isEmpty()) { + // Some "erased" non-generic types may appear as the supertypes + // of raw types, and they're different from the regular flavor + // as their own supertypes are erased, yet they're not considered + // raw. To fix the subtyping relation, we say that `C <: (erased) C` + // but `(erased) C` converts to `C` by unchecked conversion, without + // warning. + boolean tRaw = t.hasErasedSuperTypes(); + boolean sRaw = s.hasErasedSuperTypes(); + if (tRaw && !sRaw) { + return Convertibility.UNCHECKED_NO_WARNING; + } else { + return Convertibility.SUBTYPING; + } + } + // for some C, S = C<...> and T = C, ie T is raw + // T is convertible to S, by unchecked conversion. + // If S = D, then the conversion produces + // no unchecked warning. + return allArgsAreUnboundedWildcards(sargs) ? Convertibility.UNCHECKED_NO_WARNING + : Convertibility.UNCHECKED_WARNING; + } + + if (targs.size() != sargs.size()) { + // types are not well-formed + return Convertibility.NEVER; + } + + Convertibility result = Convertibility.SUBTYPING; + for (int i = 0; i < targs.size(); i++) { + Convertibility sub = typeArgContains(sargs.get(i), targs.get(i)); + if (sub == Convertibility.NEVER) { + return Convertibility.NEVER; + } + result = result.and(sub); + } + + return result; + } + + /** + * Returns true if {@code T <= S}, ie "S contains T". + * + *

S contains T if: + * + *

{@code L(S) <: L(T) && U(T) <: U(S)} + * + *

This only makes sense for type arguments, it's a component of + * subtype checks for parameterized types: + * + *

{@code C <: C if S <= T} + * + *

Defined in JLSยง4.5.1 (Type Arguments of Parameterized Types) + */ + Convertibility typeArgContains(JTypeMirror s, JTypeMirror t) { + // the contains relation can be understood intuitively if we + // represent types as ranges on a line: + + // โŠฅ ---------L(S)---L(T)------U(T)-----U(S)---> Object + // range of S [-------------------------] + // range of T [---------] + + // here S contains T because its range is greater + + // since a wildcard is either "super" or "extends", in reality + // either L(S) = โŠฅ, or U(S) = Object. + + // meaning when S != T, we only have two scenarios where T <= S: + + // โŠฅ -------U(T)-----U(S)------> Object (L(T) = L(S) = โŠฅ) + // โŠฅ -------L(S)-----L(T)------> Object (U(T) = U(S) = Object) + + if (isSameType(s, t, pure, false)) { + // S <= S + return Convertibility.SUBTYPING; + } + + if (s instanceof JWildcardType) { + JWildcardType sw = (JWildcardType) s; + + // capt(? extends T) <= ? extends T + // capt(? super T) <= ? super T + if (t instanceof JTypeVar && ((JTypeVar) t).isCaptureOf(sw)) { + return Convertibility.SUBTYPING; + } + + if (sw.isUpperBound()) { + // Test U(T) <: U(S), we already know L(S) <: L(T), because L(S) is bottom + return this.isConvertible(wildUpperBound(t), sw.asUpperBound()); + } else { + // Test L(S) <: L(T), we already know U(T) <: U(S), because U(S) is top + return this.isConvertible(sw.asLowerBound(), wildLowerBound(t)); + } + } + + return Convertibility.NEVER; + } + @Override public Convertibility visit(JTypeMirror t, JTypeMirror s) { throw new IllegalStateException("Should not be called"); @@ -797,9 +800,9 @@ public final class TypeOps { return Convertibility.SUBTYPING; } if (isTypeRange(s)) { - return isConvertible(t, lowerBoundRec(s), true, pure); + return isConvertible(t, lowerBoundRec(s)); } - return isConvertible(t.getUpperBound(), s, true, pure); + return isConvertible(t.getUpperBound(), s); } @Override @@ -851,7 +854,7 @@ public final class TypeOps { // a raw type C is a supertype for all the family of parameterized type generated by C return Convertibility.SUBTYPING; } else { - return typeArgsAreContained(superDecl, cs, pure); + return typeArgsAreContained(superDecl, cs); } } @@ -875,7 +878,7 @@ public final class TypeOps { // what we mean is, if S is an intersection, then // "any component of T subtypes any component of S" - return Convertibility.anySubTypesAny(t.getComponents(), asList(s), pure); + return anySubTypesAny(t.getComponents(), asList(s)); } @Override @@ -896,7 +899,7 @@ public final class TypeOps { // arrays of primitive types have no sub-/ supertype return Convertibility.subtypeIf(cs.getComponentType() == t.getComponentType()); } else { - return isConvertible(t.getComponentType(), cs.getComponentType(), true, pure); + return isConvertible(t.getComponentType(), cs.getComponentType()); } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt index 2cd3888ae8..9899f11226 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TestUtilitiesForTypes.kt @@ -14,7 +14,8 @@ import net.sourceforge.pmd.lang.java.JavaParsingHelper import net.sourceforge.pmd.lang.java.ast.InvocationNode import net.sourceforge.pmd.lang.java.ast.TypeNode import net.sourceforge.pmd.lang.java.symbols.internal.asm.AsmSymbolResolver -import net.sourceforge.pmd.lang.java.types.TypeOps.* +import net.sourceforge.pmd.lang.java.types.TypeOps.Convertibility +import net.sourceforge.pmd.lang.java.types.TypeOps.isSameTypeWithSameAnnotations import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.test.ast.shouldBeA import org.hamcrest.Description @@ -168,18 +169,18 @@ fun assertSubtypeOrdering(vararg ts: JTypeMirror) { fun JClassType.parameterize(m1: JTypeMirror, vararg mirror: JTypeMirror): JClassType = withTypeArguments(listOf(m1, *mirror)) fun assertSubtype(t: JTypeMirror, s: JTypeMirror, capture: Boolean = true, passes: Convertibility.() -> Boolean) { - val res = isConvertible(t, s, capture, true) + val res = if (capture) TypeOps.isConvertiblePure(t, s) else TypeOps.isConvertibleNoCapture(t, s) assertTrue("$t \n\t\t<: $s") { res.passes() } } infix fun JTypeMirror.shouldSubtypeNoCapture(s: JTypeMirror) { - assertSubtype(this, s, false) { bySubtyping() } + assertSubtype(this, s, capture = false) { bySubtyping() } } infix fun JTypeMirror.shouldNotSubtypeNoCapture(s: JTypeMirror) { - assertSubtype(this, s, false) { never() } + assertSubtype(this, s, capture = false) { never() } } infix fun JTypeMirror.shouldBeSubtypeOf(other: JTypeMirror) { From 62cc3b134918e526f1e1d802058d31a1533ab878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 6 May 2024 12:30:58 +0200 Subject: [PATCH 042/121] fix release notes --- docs/pages/release_notes.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 1a4e0417e7..c540dcfade 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -16,8 +16,14 @@ This is a {{ site.pmd.release_type }} release. ### ๐Ÿ› Fixed Issues +* core + * [#4978](https://github.com/pmd/pmd/issues/4978): \[core] Referenced Rulesets do not emit details on validation errors + * [#4983](https://github.com/pmd/pmd/pull/4983): \[cpd] Fix CPD crashes about unicode escapes * java + * [#4912](https://github.com/pmd/pmd/issues/4912): \[java] Unable to parse some Java9+ resource references + * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number + * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4852](https://github.com/pmd/pmd/issues/4852): \[java] ReplaceVectorWithList false-positive (neither Vector nor List usage) From a72f851514ffcfdd0e4d325815fbaf3d4987d52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 6 May 2024 12:33:40 +0200 Subject: [PATCH 043/121] Invert booleans --- .../pmd/lang/java/types/TypeOps.java | 44 +++++++++---------- .../internal/infer/IncorporationAction.java | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 593ce994c9..d494244994 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -136,27 +136,27 @@ public final class TypeOps { } public static boolean areSameTypes(List ts, List ss) { - return areSameTypes(ts, ss, EMPTY, false, false); - } - - public static boolean areSameTypesInInference(List ts, List ss) { return areSameTypes(ts, ss, EMPTY, true, false); } - private static boolean areSameTypes(List ts, List ss, boolean inInference, boolean considerAnnotations) { - return areSameTypes(ts, ss, EMPTY, inInference, considerAnnotations); + public static boolean areSameTypesInInference(List ts, List ss) { + return areSameTypes(ts, ss, EMPTY, false, false); + } + + private static boolean areSameTypes(List ts, List ss, boolean pure, boolean considerAnnotations) { + return areSameTypes(ts, ss, EMPTY, pure, considerAnnotations); } private static boolean areSameTypes(List ts, List ss, Substitution subst) { - return areSameTypes(ts, ss, subst, false, false); + return areSameTypes(ts, ss, subst, true, false); } - private static boolean areSameTypes(List ts, List ss, Substitution subst, boolean inInference, boolean considerAnnotations) { + private static boolean areSameTypes(List ts, List ss, Substitution subst, boolean pure, boolean considerAnnotations) { if (ts.size() != ss.size()) { return false; } for (int i = 0; i < ts.size(); i++) { - if (!isSameType(ts.get(i), ss.get(i).subst(subst), !inInference, considerAnnotations)) { + if (!isSameType(ts.get(i), ss.get(i).subst(subst), pure, considerAnnotations)) { return false; } } @@ -166,15 +166,15 @@ public final class TypeOps { // note that this does not take type annotations into account private static final class SameTypeVisitor implements JTypeVisitor { - static final SameTypeVisitor INFERENCE = new SameTypeVisitor(true, false); - static final SameTypeVisitor PURE = new SameTypeVisitor(false, false); - static final SameTypeVisitor PURE_WITH_ANNOTATIONS = new SameTypeVisitor(false, true); + static final SameTypeVisitor INFERENCE = new SameTypeVisitor(false, false); + static final SameTypeVisitor PURE = new SameTypeVisitor(true, false); + static final SameTypeVisitor PURE_WITH_ANNOTATIONS = new SameTypeVisitor(true, true); - private final boolean inInference; + private final boolean pure; private final boolean considerAnnotations; - private SameTypeVisitor(boolean inInference, boolean considerAnnotations) { - this.inInference = inInference; + private SameTypeVisitor(boolean pure, boolean considerAnnotations) { + this.pure = pure; this.considerAnnotations = considerAnnotations; } @@ -195,8 +195,8 @@ public final class TypeOps { JClassType s2 = (JClassType) s; return t.getSymbol().equals(s2.getSymbol()) // maybe compare the type system as well. && t.hasErasedSuperTypes() == s2.hasErasedSuperTypes() - && isSameType(t.getEnclosingType(), s2.getEnclosingType(), !inInference, considerAnnotations) - && areSameTypes(t.getTypeArgs(), s2.getTypeArgs(), inInference, considerAnnotations); + && isSameType(t.getEnclosingType(), s2.getEnclosingType(), pure, considerAnnotations) + && areSameTypes(t.getTypeArgs(), s2.getTypeArgs(), pure, considerAnnotations); } return false; } @@ -212,12 +212,12 @@ public final class TypeOps { return false; } JWildcardType s2 = (JWildcardType) s; - return s2.isUpperBound() == t.isUpperBound() && isSameType(t.getBound(), s2.getBound(), !inInference, considerAnnotations); + return s2.isUpperBound() == t.isUpperBound() && isSameType(t.getBound(), s2.getBound(), pure, considerAnnotations); } @Override public Boolean visitInferenceVar(InferenceVar t, JTypeMirror s) { - if (!inInference) { + if (pure) { return t == s; } @@ -254,7 +254,7 @@ public final class TypeOps { return false; } - if (!isSameType(t.getPrimaryBound(), s2.getPrimaryBound(), !inInference, considerAnnotations)) { + if (!isSameType(t.getPrimaryBound(), s2.getPrimaryBound(), pure, considerAnnotations)) { return false; } @@ -263,7 +263,7 @@ public final class TypeOps { boolean found = false; for (JTypeMirror si : sComps) { // todo won't this behaves weirdly during inference? test it - if (isSameType(ti, si, !inInference, considerAnnotations)) { + if (isSameType(ti, si, pure, considerAnnotations)) { found = true; break; } @@ -278,7 +278,7 @@ public final class TypeOps { @Override public Boolean visitArray(JArrayType t, JTypeMirror s) { return s instanceof JArrayType - && isSameType(t.getComponentType(), ((JArrayType) s).getComponentType(), !inInference, considerAnnotations); + && isSameType(t.getComponentType(), ((JArrayType) s).getComponentType(), pure, considerAnnotations); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java index cc9bc4f9ec..74e89636f1 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/IncorporationAction.java @@ -54,7 +54,7 @@ abstract class IncorporationAction { this.myBound = bound; } - public static boolean isClassType(JTypeMirror bound) { + private static boolean isClassType(JTypeMirror bound) { JTypeDeclSymbol symbol = bound.getSymbol(); return symbol instanceof JClassSymbol && !symbol.isInterface(); } From 3d4f165bbdd49f6b4048d387352abbfbb8736a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 6 May 2024 12:41:08 +0200 Subject: [PATCH 044/121] Add back removed method for compatibility --- .../java/net/sourceforge/pmd/lang/java/types/TypeOps.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index d494244994..0398a5c2d8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -401,6 +401,11 @@ public final class TypeOps { return SubtypeVisitor.INFERENCE.isConvertible(t, s); } + @Deprecated // unused + public static Convertibility isConvertible(@NonNull JTypeMirror t, @NonNull JTypeMirror s, boolean capture) { + return SubtypeVisitor.PURE.isConvertible(t, s, capture); + } + public static Convertibility isConvertibleNoCapture(@NonNull JTypeMirror t, @NonNull JTypeMirror s) { return SubtypeVisitor.PURE.isConvertible(t, s, false); } From e5f55c08a5b2fb31820bca04fb23416cdd884611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 10 May 2024 20:30:59 +0200 Subject: [PATCH 045/121] Add test case for #1160 --- .../xml/ConsecutiveAppendsShouldReuse.xml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/ConsecutiveAppendsShouldReuse.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/ConsecutiveAppendsShouldReuse.xml index 6f04e64778..863971af4b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/ConsecutiveAppendsShouldReuse.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/ConsecutiveAppendsShouldReuse.xml @@ -274,4 +274,29 @@ public class Foo { } ]]> + + FN within lambda #1160 + 1 + stream) { + return stream.reduce(new StringBuilder(1_000), (builder, string) -> { + switch (string) { + case "asd": + builder.append("asd"); + builder.append("qwe"); + break; + } + return builder; + }, (t, s) -> { + t.append(s); + return t; + }).toString(); + } + } + ]]> + From 02cb5701fadbfe387bdb86c616f9e40307eb5c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 14:55:14 +0200 Subject: [PATCH 046/121] Fix #1619 - LocalVariableCouldBeFinal FP with loops --- .../lang/java/ast/internal/JavaAstUtils.java | 9 +++++++ .../LocalVariableCouldBeFinalRule.java | 14 ++++++++-- .../MethodArgumentCouldBeFinalRule.java | 27 ++++--------------- .../xml/LocalVariableCouldBeFinal.xml | 11 ++++++++ 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java index f71a5c1a7e..6949999978 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java @@ -802,4 +802,13 @@ public final class JavaAstUtils { || it instanceof ASTExplicitConstructorInvocation ); } + + public static boolean isEffectivelyFinal(ASTVariableId var) { + for (ASTNamedReferenceExpr usage : var.getLocalUsages()) { + if (usage.getAccessType() == AccessType.WRITE) { + return false; + } + } + return true; + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java index 47bc0b8846..6776ac2384 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java @@ -8,9 +8,10 @@ import static net.sourceforge.pmd.properties.PropertyFactory.booleanProperty; import net.sourceforge.pmd.lang.java.ast.ASTForeachStatement; import net.sourceforge.pmd.lang.java.ast.ASTLocalVariableDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTVariableId; +import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.properties.PropertyDescriptor; -import net.sourceforge.pmd.reporting.RuleContext; public class LocalVariableCouldBeFinalRule extends AbstractJavaRulechainRule { @@ -30,7 +31,16 @@ public class LocalVariableCouldBeFinalRule extends AbstractJavaRulechainRule { if (getProperty(IGNORE_FOR_EACH) && node.getParent() instanceof ASTForeachStatement) { return data; } - MethodArgumentCouldBeFinalRule.checkForFinal((RuleContext) data, node.getVarIds()); + if (node.getVarIds().all(JavaAstUtils::isEffectivelyFinal)) { + // All variables declared in this ASTLocalVariableDeclaration need to be + // effectively final, otherwise we cannot just add a final modifier. + for (ASTVariableId vid : node.getVarIds()) { + if (!vid.getLocalUsages().isEmpty()) { + // filter out unused variables + asCtx(data).addViolation(vid, vid.getName()); + } + } + } return data; } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java index efbb5102a4..b8a2d73281 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java @@ -4,16 +4,13 @@ package net.sourceforge.pmd.lang.java.rule.codestyle; -import net.sourceforge.pmd.lang.ast.NodeStream; -import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; -import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType; import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; +import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; -import net.sourceforge.pmd.reporting.RuleContext; public class MethodArgumentCouldBeFinalRule extends AbstractJavaRulechainRule { @@ -37,24 +34,10 @@ public class MethodArgumentCouldBeFinalRule extends AbstractJavaRulechainRule { } private void lookForViolation(ASTExecutableDeclaration node, Object data) { - checkForFinal((RuleContext) data, node.getFormalParameters().toStream().map(ASTFormalParameter::getVarId)); - } - - static void checkForFinal(RuleContext ruleContext, NodeStream variables) { - outer: - for (ASTVariableId var : variables) { - if (var.isFinal()) { - continue; - } - boolean used = false; - for (ASTNamedReferenceExpr usage : var.getLocalUsages()) { - used = true; - if (usage.getAccessType() == AccessType.WRITE) { - continue outer; - } - } - if (used) { - ruleContext.addViolation(var, var.getName()); + for (ASTFormalParameter param : node.getFormalParameters()) { + ASTVariableId varId = param.getVarId(); + if (!param.isFinal() && !varId.getLocalUsages().isEmpty() && JavaAstUtils.isEffectivelyFinal(varId)) { + asCtx(data).addViolation(varId, varId.getName()); } } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml index 69686f20af..fa3a52ba2c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml @@ -308,6 +308,17 @@ public class ClassWithLambda { System.out.println(a); }; } +} + ]]> + + + #1619 FP with loop variable + 0 + From c140acd8f94013fc5cb142449c25570f9859180c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 15:17:27 +0200 Subject: [PATCH 047/121] Fix #3122 - LocalVariableCouldBeFinal should consider blank local variables --- .../lang/java/ast/internal/JavaAstUtils.java | 22 ++++++++ .../LocalVariableCouldBeFinalRule.java | 2 +- .../MethodArgumentCouldBeFinalRule.java | 4 +- .../lang/java/rule/internal/DataflowPass.java | 37 ++++++++++--- .../java/rule/internal/DataflowPassTest.java | 54 ++++++++++++++++++- .../xml/LocalVariableCouldBeFinal.xml | 34 ++++++++++++ 6 files changed, 143 insertions(+), 10 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java index 6949999978..8dbafd8bdc 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java @@ -75,6 +75,9 @@ import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility; import net.sourceforge.pmd.lang.java.ast.QualifiableExpression; import net.sourceforge.pmd.lang.java.ast.TypeNode; import net.sourceforge.pmd.lang.java.ast.UnaryOp; +import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass; +import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.DataflowResult; +import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.ReachingDefinitionSet; import net.sourceforge.pmd.lang.java.rule.internal.JavaRuleUtil; import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; @@ -803,7 +806,26 @@ public final class JavaAstUtils { ); } + /** + * Return true if the variable is effectively final. This means + * the variable is never reassigned. + */ public static boolean isEffectivelyFinal(ASTVariableId var) { + if (var.getInitializer() == null && var.isLocalVariable()) { + // blank variables may be assigned on several paths + DataflowResult dataflow = DataflowPass.getDataflowResult(var.getRoot()); + for (ASTNamedReferenceExpr usage : var.getLocalUsages()) { + if (usage.getAccessType() == AccessType.WRITE) { + ReachingDefinitionSet reaching = dataflow.getReachingDefinitions(usage); + if (reaching.isNotFullyKnown() || !reaching.getReaching().isEmpty()) { + // If the reaching def is not empty, then that means + // the assignment is killing another one, ie it is a reassignment. + return false; + } + } + } + return true; + } for (ASTNamedReferenceExpr usage : var.getLocalUsages()) { if (usage.getAccessType() == AccessType.WRITE) { return false; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java index 6776ac2384..ec60baffac 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/LocalVariableCouldBeFinalRule.java @@ -35,7 +35,7 @@ public class LocalVariableCouldBeFinalRule extends AbstractJavaRulechainRule { // All variables declared in this ASTLocalVariableDeclaration need to be // effectively final, otherwise we cannot just add a final modifier. for (ASTVariableId vid : node.getVarIds()) { - if (!vid.getLocalUsages().isEmpty()) { + if (!JavaAstUtils.isNeverUsed(vid)) { // filter out unused variables asCtx(data).addViolation(vid, vid.getName()); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java index b8a2d73281..23b180e761 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/MethodArgumentCouldBeFinalRule.java @@ -36,7 +36,9 @@ public class MethodArgumentCouldBeFinalRule extends AbstractJavaRulechainRule { private void lookForViolation(ASTExecutableDeclaration node, Object data) { for (ASTFormalParameter param : node.getFormalParameters()) { ASTVariableId varId = param.getVarId(); - if (!param.isFinal() && !varId.getLocalUsages().isEmpty() && JavaAstUtils.isEffectivelyFinal(varId)) { + if (!param.isFinal() + && !JavaAstUtils.isNeverUsed(varId) + && JavaAstUtils.isEffectivelyFinal(varId)) { asCtx(data).addViolation(varId, varId.getName()); } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java index 6624bc5323..fe0b890f35 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java @@ -4,6 +4,7 @@ package net.sourceforge.pmd.lang.java.rule.internal; +import static java.util.Collections.emptySet; import static net.sourceforge.pmd.util.CollectionUtil.asSingle; import java.util.ArrayDeque; @@ -177,12 +178,21 @@ public final class DataflowPass { */ public static final class ReachingDefinitionSet { + static final ReachingDefinitionSet UNKNOWN = new ReachingDefinitionSet(); + static final ReachingDefinitionSet EMPTY_KNOWN = new ReachingDefinitionSet(emptySet()); + private Set reaching; private boolean isNotFullyKnown; private boolean containsInitialFieldValue; + + static { + assert !EMPTY_KNOWN.isNotFullyKnown(); + assert UNKNOWN.isNotFullyKnown(); + } + private ReachingDefinitionSet() { - this.reaching = Collections.emptySet(); + this.reaching = emptySet(); this.containsInitialFieldValue = false; this.isNotFullyKnown = true; } @@ -226,7 +236,11 @@ public final class DataflowPass { } public static ReachingDefinitionSet unknown() { - return new ReachingDefinitionSet(); + return UNKNOWN; + } + + public static ReachingDefinitionSet blank() { + return EMPTY_KNOWN; } } @@ -256,7 +270,7 @@ public final class DataflowPass { * May be useful to check for reassignment. */ public @NonNull Set getKillers(AssignmentEntry assignment) { - return killRecord.getOrDefault(assignment, Collections.emptySet()); + return killRecord.getOrDefault(assignment, emptySet()); } // These methods are only valid to be called if the dataflow pass has run. @@ -278,14 +292,25 @@ public final class DataflowPass { return expr.getUserMap().computeIfAbsent(REACHING_DEFS, () -> reachingFallback(expr)); } - // Fallback, to compute reaching definitions for some fields + // Fallback, to compute reaching definitions for some nodes // that are not tracked by the tree exploration. Final fields // indeed have a fully known set of reaching definitions. - // TODO maybe they should actually be tracked? private @NonNull ReachingDefinitionSet reachingFallback(ASTNamedReferenceExpr expr) { JVariableSymbol sym = expr.getReferencedSym(); - if (sym == null || !sym.isField() || !sym.isFinal()) { + if (sym == null || sym.isField() && !sym.isFinal()) { return ReachingDefinitionSet.unknown(); + } else if (!sym.isField()) { + ASTVariableId node = sym.tryGetNode(); + assert node != null + : "Not a field, and symbol is known, so should be a local which has a node"; + if (node.isLocalVariable()) { + assert node.getInitializer() == null : "Should be a blank local variable"; + return ReachingDefinitionSet.blank(); + } else { + // Formal parameter or other kind of def which has + // an implicit initializer. + return ReachingDefinitionSet.unknown(); + } } ASTVariableId node = sym.tryGetNode(); diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java index 3fb0c5506d..b33e3cfeea 100644 --- a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPassTest.java @@ -5,13 +5,22 @@ package net.sourceforge.pmd.lang.java.rule.internal; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.List; -import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import net.sourceforge.pmd.lang.java.BaseParserTest; import net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit; +import net.sourceforge.pmd.lang.java.ast.ASTVariableId; +import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; +import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.AssignmentEntry; import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.DataflowResult; +import net.sourceforge.pmd.lang.java.rule.internal.DataflowPass.ReachingDefinitionSet; /** * @author Clรฉment Fournier @@ -28,8 +37,49 @@ class DataflowPassTest extends BaseParserTest { ); DataflowResult dataflow = DataflowPass.getDataflowResult(ast); - assertThat(dataflow.getUnusedAssignments(), Matchers.hasSize(0)); + assertThat(dataflow.getUnusedAssignments(), hasSize(0)); } + @Test + void testBlankLocals() { + ASTCompilationUnit ast = java.parse( + "class A { static {" + + " int a;" + + " a = 0;" + + " } }"); + DataflowResult df = DataflowPass.getDataflowResult(ast); + List list = ast.descendants(ASTVariableId.class).toList(); + ASTVariableId a = list.get(0); + ReachingDefinitionSet reachingAEqZero = df.getReachingDefinitions(a.getLocalUsages().get(0)); + assertThat(reachingAEqZero.isNotFullyKnown(), is(false)); + assertThat(reachingAEqZero.getReaching(), hasSize(0)); + } + + @Test + void testBlankFinalField() { + ASTCompilationUnit ast = java.parse( + "class A { final int field; int nonFinal; A() { field = 2; } {" + + " use(field);" + + " use(nonFinal);" + + " } }"); + DataflowResult df = DataflowPass.getDataflowResult(ast); + List list = ast.descendants(ASTVariableId.class).toList(); + ASTVariableId field = list.get(0); + ReachingDefinitionSet finalUse = df.getReachingDefinitions(field.getLocalUsages().get(0)); + assertThat(finalUse.isNotFullyKnown(), is(false)); + assertThat(finalUse.getReaching(), hasSize(1)); + AssignmentEntry assignment = finalUse.getReaching().iterator().next(); + assertFalse(assignment.isBlankDeclaration()); + assertFalse(assignment.isFieldDefaultValue()); + assertTrue(JavaAstUtils.isLiteralInt(assignment.rhs, 2)); + + ASTVariableId nonFinal = list.get(1); + ReachingDefinitionSet nonFinalUse = df.getReachingDefinitions(nonFinal.getLocalUsages().get(0)); + assertThat(nonFinalUse.isNotFullyKnown(), is(true)); + assertThat(nonFinalUse.getReaching(), hasSize(1)); + assignment = nonFinalUse.getReaching().iterator().next(); + assertTrue(assignment.isBlankDeclaration()); + assertTrue(assignment.isFieldDefaultValue()); + } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml index fa3a52ba2c..209d2cbd55 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml @@ -319,6 +319,40 @@ public class ClassWithLambda { void method() { for (int i = 0, size = loaders.size(); i < size; ++i); } +} + ]]> + + + #3122 should consider blank variables + 2 + 7,19 + From f1b2cda3dc79305baabe0c1b60676e70b719495d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 12 Apr 2024 14:39:06 +0200 Subject: [PATCH 048/121] Make variable naming conventions skip unnamed variables Fix #4954 --- .../net/sourceforge/pmd/lang/java/ast/ASTVariableId.java | 9 +++++++++ .../codestyle/FormalParameterNamingConventionsRule.java | 4 ++++ .../codestyle/LocalVariableNamingConventionsRule.java | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java index 88f97fecfe..a5d03005e0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java @@ -127,6 +127,15 @@ public final class ASTVariableId extends AbstractTypedSymbolDeclarator Date: Fri, 12 Apr 2024 14:48:54 +0200 Subject: [PATCH 049/121] Don"t add unnamed variables to symtable --- .../table/internal/SymTableFactory.java | 20 ++++++++- .../symbols/table/internal/VarScopingTest.kt | 41 +++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java index f531e1725e..680679ba46 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java @@ -23,6 +23,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; +import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTList; @@ -365,9 +366,13 @@ final class SymTableFactory { * of fields by local variables and formals. */ JSymbolTable bodyDeclaration(JSymbolTable parent, JClassType enclosing, @Nullable ASTFormalParameters formals, @Nullable ASTTypeParameters tparams) { + NodeStream namedFormals = ASTList.orEmptyStream(formals).map(ASTFormalParameter::getVarId); + if (unnamedVariableIsSupported()) { + namedFormals = namedFormals.filterNot(ASTVariableId::isUnnamed); + } return new SymbolTableImpl( - VARS.shadow(varNode(parent), ScopeInfo.FORMAL_PARAM, VARS.groupByName(ASTList.orEmptyStream(formals), fp -> { - JVariableSymbol sym = fp.getVarId().getSymbol(); + VARS.shadow(varNode(parent), ScopeInfo.FORMAL_PARAM, VARS.groupByName(namedFormals, fp -> { + JVariableSymbol sym = fp.getSymbol(); return sym.getTypeSystem().sigOf(enclosing, (JFormalParamSymbol) sym); })), TYPES.shadow(typeNode(parent), ScopeInfo.TYPE_PARAM, TYPES.groupByName(ASTList.orEmptyStream(tparams), ASTTypeParameter::getTypeMirror)), @@ -386,15 +391,26 @@ final class SymTableFactory { JSymbolTable localVarSymTable(JSymbolTable parent, JClassType enclosing, Iterable ids) { List sigs = new ArrayList<>(); for (ASTVariableId id : ids) { + if (unnamedVariableIsSupported() && id.isUnnamed()) { + continue; + } sigs.add(id.getTypeSystem().sigOf(enclosing, (JLocalVariableSymbol) id.getSymbol())); } return SymbolTableImpl.withVars(parent, VARS.augment(varNode(parent), false, ScopeInfo.LOCAL, VARS.groupByName(sigs))); } JSymbolTable localVarSymTable(JSymbolTable parent, JClassType enclosing, JVariableSymbol id) { + if (unnamedVariableIsSupported() && "_".equals(id.getSimpleName())) { + // unnamed variable + return parent; + } return SymbolTableImpl.withVars(parent, VARS.augment(varNode(parent), false, ScopeInfo.LOCAL, id.getTypeSystem().sigOf(enclosing, (JLocalVariableSymbol) id))); } + private boolean unnamedVariableIsSupported() { + return processor.getJdkVersion() >= 22; + } + JSymbolTable localTypeSymTable(JSymbolTable parent, JClassType sym) { // TODO is this really not a shadow barrier? return SymbolTableImpl.withTypes(parent, TYPES.augment(typeNode(parent), false, ScopeInfo.LOCAL, sym)); diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 6f4eef0e86..e3886bd1a4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt @@ -4,14 +4,18 @@ package net.sourceforge.pmd.lang.java.symbols.table.internal +import io.kotest.assertions.withClue import io.kotest.matchers.collections.beEmpty import io.kotest.matchers.collections.shouldBeEmpty import io.kotest.matchers.should import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* +import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.since +import net.sourceforge.pmd.lang.java.ast.JavaVersion.J22 import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol import net.sourceforge.pmd.lang.java.symbols.JLocalVariableSymbol +import net.sourceforge.pmd.lang.java.types.methodCalls import net.sourceforge.pmd.lang.java.types.shouldHaveType import net.sourceforge.pmd.lang.test.ast.* import net.sourceforge.pmd.lang.test.ast.shouldBe @@ -472,6 +476,43 @@ class VarScopingTest : ProcessorTestSpec({ } } + parserTest("Unnamed variables", javaVersions = since(J22)) { + + val acu = parser.parse(""" + + class Scratch { + interface Consumer { void accept(T t); } + + public static void main(String[] _) { // formal param + foo(); + + try (var _ = new StringReader("")) { // resource + foo(); + } catch (Exception _) { // catchParam + foo(); + } + + int _ = 2; // local + foo(); + + if (this instanceof Runnable _) { // in pattern matching + foo(); + } + + Consumer consumer = _ -> { foo(); }; + } + } + + """.trimIndent()) + + for (call in acu.methodCalls()) { + withClue(call) { + call.symbolTable.variables().resolve("_").shouldBeEmpty() + } + } + + + } }) From 690ff9d6e4779d96ee64173b363fe926f805410c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 15:56:49 +0200 Subject: [PATCH 050/121] Add tests --- .../xml/FormalParameterNamingConventions.xml | 22 ++++++++++++++++++ .../xml/LocalVariableNamingConventions.xml | 23 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/FormalParameterNamingConventions.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/FormalParameterNamingConventions.xml index 0919eae7c0..ae82959452 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/FormalParameterNamingConventions.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/FormalParameterNamingConventions.xml @@ -217,4 +217,26 @@ public class Bar { } ]]> + + #4954 Test unnamed vars are not checked + abc + abc + abc + abc + 0 + _ = (final String _) -> {}; + Consumer _ = (String _) -> {}; + Consumer _ = (_) -> {}; + Consumer _ = (var _) -> {}; + Consumer _ = (final var _) -> {}; + Consumer _ = _ -> {}; + } + } + ]]> + java 22 + + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableNamingConventions.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableNamingConventions.xml index aa280769c5..12be151bdb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableNamingConventions.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableNamingConventions.xml @@ -126,4 +126,27 @@ public class LocalVarNamingConvention { } ]]> + + #4954 Test unnamed vars are not checked + abc + abc + abc + 0 + + java 22 + From 40c7ffe03e245a7b12e9328463c3dc6ed91d90ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 16:01:38 +0200 Subject: [PATCH 051/121] Update reference files --- .../sourceforge/pmd/lang/java/ast/Bug1429.txt | 8 +- .../lang/java/ast/GitHubBug1780OuterClass.txt | 2 +- .../pmd/lang/java/ast/GitHubBug207.txt | 2 +- .../pmd/lang/java/ast/GitHubBug309.txt | 6 +- .../pmd/lang/java/ast/LambdaBug1333.txt | 8 +- .../pmd/lang/java/ast/LambdaBug1470.txt | 10 +- .../pmd/lang/java/ast/LambdaBug206.txt | 2 +- .../pmd/lang/java/ast/ParserCornerCases.txt | 46 +++--- .../pmd/lang/java/ast/ParserCornerCases17.txt | 90 +++++----- .../pmd/lang/java/ast/ParserCornerCases18.txt | 156 +++++++++--------- .../pmd/lang/java/ast/SwitchStatements.txt | 2 +- .../lang/java/ast/SwitchWithFallthrough.txt | 2 +- .../java14/MultipleCaseLabels.txt | 18 +- .../java14/SimpleSwitchExpressions.txt | 26 +-- .../java14/SwitchExpressions.txt | 38 ++--- .../jdkversiontests/java14/SwitchRules.txt | 18 +- .../java14/YieldStatements.txt | 2 +- .../java15/NonSealedIdentifier.txt | 8 +- .../ast/jdkversiontests/java15/TextBlocks.txt | 38 ++--- .../LocalClassAndInterfaceDeclarations.txt | 6 +- .../jdkversiontests/java16/LocalRecords.txt | 32 ++-- .../java16/NonSealedIdentifier.txt | 8 +- .../java16/PatternMatchingInstanceof.txt | 24 +-- .../java/ast/jdkversiontests/java16/Point.txt | 8 +- .../ast/jdkversiontests/java16/Records.txt | 26 +-- .../ast/jdkversiontests/java17/LocalVars.txt | 2 +- .../java21/DealingWithNull.txt | 26 +-- .../java21/EnhancedTypeCheckingSwitch.txt | 24 +-- .../java21/ExhaustiveSwitch.txt | 34 ++-- .../java21/GuardedPatterns.txt | 36 ++-- .../java21/Jep440_RecordPatterns.txt | 72 ++++---- .../Jep441_PatternMatchingForSwitch.txt | 60 +++---- .../java21/PatternsInSwitchLabels.txt | 14 +- .../jdkversiontests/java21/RecordPatterns.txt | 102 ++++++------ .../java21/RecordPatternsExhaustiveSwitch.txt | 40 ++--- .../java21/RefiningPatternsInSwitch.txt | 26 +-- .../ScopeOfPatternVariableDeclarations.txt | 18 +- .../java21p/Jep430_StringTemplates.txt | 98 +++++------ .../Jep443_UnnamedPatternsAndVariables.txt | 90 +++++----- .../java21p/Jep445_UnnamedClasses3.txt | 2 +- .../Jep456_UnnamedPatternsAndVariables.txt | 90 +++++----- .../java22p/Jep447_StatementsBeforeSuper.txt | 38 ++--- .../java22p/Jep459_StringTemplates.txt | 98 +++++------ .../java22p/Jep463_UnnamedClasses3.txt | 2 +- .../Jep463_UnnamedClasses4WithImports.txt | 2 +- 45 files changed, 730 insertions(+), 730 deletions(-) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt index 608f1370dd..17b83ba90c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt @@ -51,13 +51,13 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "key"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "key", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "key", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] @@ -65,7 +65,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "value"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "get", @MethodName = "get", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "attributes", @Name = "attributes", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -76,7 +76,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "key", @Name = "key", @ParenthesisDepth = 0, @Parenthesized = false] +- IfStatement[@Else = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "isNotEmpty", @MethodName = "isNotEmpty", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt index 142013490b..16050e1f1a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt @@ -57,7 +57,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ArrayDimensions[@Empty = false, @Size = 1] | +- ArrayTypeDim[@Varargs = false] +- Block[@Empty = false, @Size = 1, @containsComment = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt index ca175c431d..175a25c24f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt @@ -11,7 +11,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = true, @SimpleName = "Context"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "context", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "context", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "map", @MethodName = "map", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt index 83f0187049..b487062b37 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt @@ -13,13 +13,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | +- VariableDeclarator[@Initializer = true, @Name = "r11"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Main"] @@ -34,7 +34,7 @@ | +- ArrayDimensions[@Empty = false, @Size = 1] | +- ArrayTypeDim[@Varargs = false] +- VariableDeclarator[@Initializer = true, @Name = "r13"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r13", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r13", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ArrayType[@ArrayDepth = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt index 8ed63303b7..67381432cc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt @@ -6,7 +6,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- ClassType[@FullyQualified = false, @SimpleName = "Logger"] | +- VariableDeclarator[@Initializer = true, @Name = "LOG"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LOG", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LOG", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- MethodCall[@CompileTimeConstant = false, @Image = "getLogger", @MethodName = "getLogger", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "LoggerFactory", @Name = "LoggerFactory", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -24,7 +24,7 @@ | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- MethodCall[@CompileTimeConstant = false, @Image = "deleteDirectory", @MethodName = "deleteDirectory", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "path", @Name = "path", @ParenthesisDepth = 0, @Parenthesized = false] @@ -38,7 +38,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = true, @UpperBound = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "consumer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "consumer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "debug", @MethodName = "debug", @ParenthesisDepth = 0, @Parenthesized = false] @@ -54,7 +54,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "debug", @MethodName = "debug", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt index 087f538552..1ab5ba1ae6 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt @@ -10,7 +10,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | +- VariableDeclarator[@Initializer = false, @Name = "stuff"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "stuff", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "stuff", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] @@ -32,7 +32,7 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- WildcardType[@LowerBound = true, @UpperBound = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -43,7 +43,7 @@ | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -62,7 +62,7 @@ | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -73,5 +73,5 @@ +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "authToken", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt index 4d2966d6cd..4b45f42778 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt @@ -10,7 +10,7 @@ | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] +- VariableDeclarator[@Initializer = true, @Name = "interner"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "interner", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PUBLIC] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "interner", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- MethodCall[@CompileTimeConstant = false, @Image = "withInitial", @MethodName = "withInitial", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassType[@FullyQualified = false, @SimpleName = "ThreadLocal"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt index 8860f0dbb2..b9bda24a4f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt @@ -16,7 +16,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "clazz", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "clazz", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "doStuff", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -27,7 +27,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -71,7 +71,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Outer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = true, @Super = true, @This = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -100,7 +100,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] @@ -116,11 +116,11 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] @@ -134,7 +134,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -147,7 +147,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "doStuff", @MethodName = "doStuff", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] @@ -158,7 +158,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "v"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "v", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "v", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "thisGeneric", @MethodName = "thisGeneric", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] @@ -174,7 +174,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -216,7 +216,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PmdTestChild", @CanonicalName = "PmdTestChild", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdTestChild", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -244,7 +244,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "memoryMonitor"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "memoryMonitor", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "memoryMonitor", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -266,7 +266,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = false, @Name = "name"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser", @CanonicalName = "SimpleBeanUser", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 2] @@ -276,7 +276,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser", @Name = "SimpleBeanUser", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -338,7 +338,7 @@ | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] @@ -359,7 +359,7 @@ | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] | | | +- VariableDeclarator[@Initializer = true, @Name = "it"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "it", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "it", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "iterator", @MethodName = "iterator", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "values", @MethodName = "values", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "Fachabteilung", @Name = "Fachabteilung", @ParenthesisDepth = 0, @Parenthesized = false] @@ -375,7 +375,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "l"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "l", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "l", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] @@ -391,7 +391,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = false, @Name = "s"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "FooBlock", @CanonicalName = "FooBlock", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "FooBlock", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] @@ -406,7 +406,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "FooBlock"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -432,13 +432,13 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "object", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "object", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fish"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fish", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fish", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "salmon", @Empty = false, @Image = "\"salmon\"", @Length = 6, @LiteralText = "\"salmon\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "fish", @Name = "fish", @ParenthesisDepth = 0, @Parenthesized = false] @@ -475,7 +475,7 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] | | | +- VariableDeclarator[@Initializer = true, @Name = "wrapped"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_ANONYMOUS, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "wrapped", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_ANONYMOUS, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "wrapped", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "iterator", @MethodName = "iterator", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ImmutableSet"] @@ -541,7 +541,7 @@ | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- WildcardType[@LowerBound = false, @UpperBound = true] | +- VariableDeclarator[@Initializer = true, @Name = "c"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt index 8167c80f4a..d2bc131ff5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt @@ -28,7 +28,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- VariableDeclarator[@Initializer = true, @Name = "aByte"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aByte", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aByte", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- CastExpression[@CompileTimeConstant = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00100001", @IntLiteral = true, @Integral = true, @LiteralText = "0b00100001", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 33.0, @ValueAsFloat = 33.0, @ValueAsInt = 33, @ValueAsLong = 33] @@ -36,7 +36,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.SHORT] | | +- VariableDeclarator[@Initializer = true, @Name = "aShort"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aShort", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aShort", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- CastExpression[@CompileTimeConstant = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.SHORT] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b1010000101000101", @IntLiteral = true, @Integral = true, @LiteralText = "0b1010000101000101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 41285.0, @ValueAsFloat = 41285.0, @ValueAsInt = 41285, @ValueAsLong = 41285] @@ -44,25 +44,25 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000100000000010100001010001", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000100000000010100001010001", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8398929.0, @ValueAsFloat = 8398929.0, @ValueAsInt = 8398929, @ValueAsLong = 8398929] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt2"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b101", @IntLiteral = true, @Integral = true, @LiteralText = "0b101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "anInt3"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "anInt3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0B101", @IntLiteral = true, @Integral = true, @LiteralText = "0B101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "aLong"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "aLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b0000000000000000000000000000000000000000100010001000010000010000L", @IntLiteral = false, @Integral = true, @LiteralText = "0b0000000000000000000000000000000000000000100010001000010000010000L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8946704.0, @ValueAsFloat = 8946704.0, @ValueAsInt = 8946704, @ValueAsLong = 8946704] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -71,7 +71,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "phases"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phases", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phases", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 8, @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00110001", @IntLiteral = true, @Integral = true, @LiteralText = "0b00110001", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 49.0, @ValueAsFloat = 49.0, @ValueAsInt = 49, @ValueAsLong = 49] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b01100010", @IntLiteral = true, @Integral = true, @LiteralText = "0b01100010", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 98.0, @ValueAsFloat = 98.0, @ValueAsInt = 98, @ValueAsLong = 98] @@ -85,7 +85,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "instruction"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "instruction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "instruction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -98,7 +98,7 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "register"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "register", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "register", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.AND, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "instruction", @Name = "instruction", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00001111", @IntLiteral = true, @Integral = true, @LiteralText = "0b00001111", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 15.0, @ValueAsFloat = 15.0, @ValueAsInt = 15, @ValueAsLong = 15] @@ -153,91 +153,91 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "creditCardNumber"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "creditCardNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "creditCardNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1111_2222_3333_4444L", @IntLiteral = false, @Integral = true, @LiteralText = "1111_2222_3333_4444L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.111222233334444E15, @ValueAsFloat = 1.11122226E15, @ValueAsInt = -1770257748, @ValueAsLong = 1111222233334444] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "socialSecurityNumber"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "socialSecurityNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "socialSecurityNumber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "999_99_9999L", @IntLiteral = false, @Integral = true, @LiteralText = "999_99_9999L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.99999999E8, @ValueAsFloat = 1.0E9, @ValueAsInt = 999999999, @ValueAsLong = 999999999] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.FLOAT] | | +- VariableDeclarator[@Initializer = true, @Name = "pi"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = true, @Image = "3.14_15F", @IntLiteral = false, @Integral = false, @LiteralText = "3.14_15F", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.1415, @ValueAsFloat = 3.1415, @ValueAsInt = 3, @ValueAsLong = 3] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "hexBytes"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexBytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexBytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x00_11_22_33", @IntLiteral = true, @Integral = true, @LiteralText = "0x00_11_22_33", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1122867.0, @ValueAsFloat = 1122867.0, @ValueAsInt = 1122867, @ValueAsLong = 1122867] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "hexWords"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexWords", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "hexWords", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x0001_CAFE", @IntLiteral = true, @Integral = true, @LiteralText = "0x0001_CAFE", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 117502.0, @ValueAsFloat = 117502.0, @ValueAsInt = 117502, @ValueAsLong = 117502] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "maxLong"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "maxLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "maxLong", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x7fff_ffff_ffff_ffffL", @IntLiteral = false, @Integral = true, @LiteralText = "0x7fff_ffff_ffff_ffffL", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.223372036854776E18, @ValueAsFloat = 9.223372E18, @ValueAsInt = -1, @ValueAsLong = 9223372036854775807] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | +- VariableDeclarator[@Initializer = true, @Name = "nybbles"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "nybbles", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "nybbles", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b0010_0101", @IntLiteral = true, @Integral = true, @LiteralText = "0b0010_0101", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 37.0, @ValueAsFloat = 37.0, @ValueAsInt = 37, @ValueAsLong = 37] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] | | +- VariableDeclarator[@Initializer = true, @Name = "bytes"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 2, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0b00000000_10001000_10000100_00010000", @IntLiteral = true, @Integral = true, @LiteralText = "0b00000000_10001000_10000100_00010000", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8946704.0, @ValueAsFloat = 8946704.0, @ValueAsInt = 8946704, @ValueAsLong = 8946704] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "_52"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_52", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_52", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "_52", @Name = "_52", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x2"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5_2", @IntLiteral = true, @Integral = true, @LiteralText = "5_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 52.0, @ValueAsFloat = 52.0, @ValueAsInt = 52, @ValueAsLong = 52] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x4"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5_______2", @IntLiteral = true, @Integral = true, @LiteralText = "5_______2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 52.0, @ValueAsFloat = 52.0, @ValueAsInt = 52, @ValueAsLong = 52] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x7"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x7", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x7", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 16, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0x5_2", @IntLiteral = true, @Integral = true, @LiteralText = "0x5_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 82.0, @ValueAsFloat = 82.0, @ValueAsInt = 82, @ValueAsLong = 82] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x9"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x9", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x9", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 8, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0_52", @IntLiteral = true, @Integral = true, @LiteralText = "0_52", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "x10"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x10", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x10", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 8, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "05_2", @IntLiteral = true, @Integral = true, @LiteralText = "05_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "stringsInSwitchStatements", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -248,13 +248,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "dayOfWeekArg"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "dayOfWeekArg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "dayOfWeekArg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Wednesday", @Empty = false, @Image = "\"Wednesday\"", @Length = 9, @LiteralText = "\"Wednesday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = false, @Name = "typeOfDay"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "typeOfDay", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "typeOfDay", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "dayOfWeekArg", @Name = "dayOfWeekArg", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] @@ -322,7 +322,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "typeInferenceForGenericInstanceCreation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -338,7 +338,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "myMap"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myMap", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myMap", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "HashMap"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -349,7 +349,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "list"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -366,7 +366,7 @@ | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "list2"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -382,7 +382,7 @@ | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | +- VariableDeclarator[@Initializer = true, @Name = "myObject"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myObject", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myObject", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "MyClass"] | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -399,7 +399,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "path"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo", @Empty = false, @Image = "\"/foo\"", @Length = 4, @LiteralText = "\"/foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- TryStatement[@TryWithResources = true] | | +- ResourceList[@Empty = false, @Size = 1, @TrailingSemiColon = false] @@ -408,7 +408,7 @@ | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "BufferedReader"] | | | +- VariableDeclarator[@Initializer = true, @Name = "br"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "br", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "br", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "BufferedReader"] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -421,7 +421,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "first"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "first", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "first", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "readLine", @MethodName = "readLine", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "br", @Name = "br", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -429,19 +429,19 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFileName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo-out", @Empty = false, @Image = "\"/foo-out\"", @Length = 8, @LiteralText = "\"/foo-out\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipFileName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo.zip", @Empty = false, @Image = "\"/foo.zip\"", @Length = 8, @LiteralText = "\"/foo.zip\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "Charset"] | | +- VariableDeclarator[@Initializer = true, @Name = "charset"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "charset", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "charset", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "forName", @MethodName = "forName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = true, @SimpleName = "Charset"] @@ -451,7 +451,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "Path"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFilePath"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFilePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFilePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "get", @MethodName = "get", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = true, @SimpleName = "Paths"] @@ -464,7 +464,7 @@ | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipFile"] | | | +- VariableDeclarator[@Initializer = true, @Name = "zf"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "zf", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "zf", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipFile"] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -474,7 +474,7 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = true, @SimpleName = "BufferedWriter"] | | +- VariableDeclarator[@Initializer = true, @Name = "writer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "writer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "writer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "newBufferedWriter", @MethodName = "newBufferedWriter", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = true, @SimpleName = "Files"] @@ -491,7 +491,7 @@ | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ZipEntry"] | | +- VariableDeclarator[@Initializer = true, @Name = "entries"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "entries", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "entries", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "entries", @MethodName = "entries", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zf", @Name = "zf", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -503,7 +503,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "newLine"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "newLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "newLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getProperty", @MethodName = "getProperty", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] @@ -513,7 +513,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipEntryName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipEntryName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipEntryName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true] @@ -560,7 +560,7 @@ | | +- UnionType[] | | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "SQLException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ex", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ex", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] @@ -577,7 +577,7 @@ +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- VariableDeclarator[@Initializer = true, @Name = "initialSizeGlobal"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 1, @Parenthesized = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt index 5def9e475a..d62be8e25a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt @@ -21,13 +21,13 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -38,12 +38,12 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java2"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -54,12 +54,12 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java3"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -70,12 +70,12 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java4"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -97,7 +97,7 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -115,7 +115,7 @@ | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- VariableDeclarator[@Initializer = true, @Name = "filters"] - | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArrayType[@ArrayDepth = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] @@ -126,7 +126,7 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -134,7 +134,7 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -142,7 +142,7 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "startsWith", @MethodName = "startsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -162,7 +162,7 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -170,7 +170,7 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -178,7 +178,7 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "startsWith", @MethodName = "startsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] @@ -189,7 +189,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "user"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "doPrivileged", @MethodName = "doPrivileged", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -205,7 +205,7 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "c"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -213,7 +213,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -230,7 +230,7 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "sup"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sup", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sup", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -247,7 +247,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BOOLEAN] | | | +- VariableDeclarator[@Initializer = true, @Name = "flag"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "flag", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "flag", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = true, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -257,7 +257,7 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "c2"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "flag", @Name = "flag", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] @@ -270,7 +270,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -296,15 +296,15 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "comparer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "comparer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "comparer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareToIgnoreCase", @MethodName = "compareToIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s1", @Name = "s1", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -316,10 +316,10 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareToIgnoreCase", @MethodName = "compareToIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s1", @Name = "s1", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -328,7 +328,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Button"] | | | +- VariableDeclarator[@Initializer = true, @Name = "button"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "button", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "button", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Button"] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -340,7 +340,7 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -353,7 +353,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "initialSizeGlobal"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "initialSizeGlobal", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 1, @Parenthesized = true] @@ -370,17 +370,17 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -392,15 +392,15 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2a"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] | | | +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -413,21 +413,21 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = true, @Operator = AssignmentOp.ADD_ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -441,18 +441,18 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3a"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = true, @Operator = AssignmentOp.ADD_ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -474,20 +474,20 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -523,7 +523,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "PrivilegedAction"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "action", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "action", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "run", @MethodName = "run", @ParenthesisDepth = 0, @Parenthesized = false] @@ -539,7 +539,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] - | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "comparingByKey", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -572,10 +572,10 @@ | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- MethodCall[@CompileTimeConstant = false, @Image = "compareTo", @MethodName = "compareTo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getKey", @MethodName = "getKey", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] @@ -593,7 +593,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] @@ -602,14 +602,14 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- VariableDeclarator[@Initializer = true, @Name = "pc"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pc", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pc", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -617,7 +617,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r11"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pc", @Name = "pc", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -626,14 +626,14 @@ | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "s"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r2"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "staticMethod", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] @@ -646,7 +646,7 @@ | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- VariableDeclarator[@Initializer = true, @Name = "arrayMaker"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "arrayMaker", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "arrayMaker", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArrayType[@ArrayDepth = 1] @@ -660,7 +660,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "array"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "array", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "array", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "apply", @MethodName = "apply", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "arrayMaker", @Name = "arrayMaker", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = false, @Size = 1] @@ -675,7 +675,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = false, @Name = "theFunction"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "theFunction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "theFunction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "PmdTest", @Name = "PmdTest", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- FormalParameters[@Empty = true, @Size = 0] @@ -692,7 +692,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] @@ -719,7 +719,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "myString"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | | +- Annotation[@SimpleName = "NonNull"] @@ -729,7 +729,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "MyObject"] | | | +- Annotation[@SimpleName = "Interned"] @@ -780,16 +780,16 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.SUB, @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "hashCode", @MethodName = "hashCode", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] @@ -832,17 +832,17 @@ | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.SUB, @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "hashCode", @MethodName = "hashCode", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] @@ -880,7 +880,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | | +- VariableDeclarator[@Initializer = true, @Name = "request"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "request", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "request", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -987,7 +987,7 @@ | | | | +- ArrayTypeDim[@Varargs = false] | | | | +- Annotation[@SimpleName = "Anno"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Anno"] - | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "arr", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "arr", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -1026,7 +1026,7 @@ | | | | +- ArrayTypeDim[@Varargs = true] | | | | +- Annotation[@SimpleName = "NotNull"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NotNull"] - | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "array", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "array", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] @@ -1054,7 +1054,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 3, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 3] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] @@ -1087,7 +1087,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverParameterWithAnnotation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -1100,7 +1100,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "ParserCornerCases18$AnnotatedUsage", @CanonicalName = "ParserCornerCases18.AnnotatedUsage", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "AnnotatedUsage", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -1144,7 +1144,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ForStatement[] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt index 1ee0d5297d..44c6b2909b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt @@ -11,7 +11,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "a"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt index 610f877edb..cec1725c78 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchWithFallthrough.txt @@ -11,7 +11,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "a"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt index 918c051e17..add838a9bb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt @@ -6,43 +6,43 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -54,13 +54,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "day"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt index e60528906c..01313aca15 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt @@ -6,43 +6,43 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -54,18 +54,18 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "day"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "FRIDAY", @Name = "FRIDAY", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "numLetters"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] @@ -94,7 +94,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "k"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -102,7 +102,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "f", @MethodName = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false] @@ -123,7 +123,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt index 408ae2734d..eee3f0adeb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt @@ -7,30 +7,30 @@ | +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 7, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "MONDAY", @MethodName = "new", @Name = "MONDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "TUESDAY", @MethodName = "new", @Name = "TUESDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "WEDNESDAY", @MethodName = "new", @Name = "WEDNESDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "THURSDAY", @MethodName = "new", @Name = "THURSDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "FRIDAY", @MethodName = "new", @Name = "FRIDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "SATURDAY", @MethodName = "new", @Name = "SATURDAY", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PRIVATE, @Image = "SUNDAY", @MethodName = "new", @Name = "SUNDAY", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Static = true, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "BAZ"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BAZ", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BAZ", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -42,13 +42,13 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 15, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Day"] | | +- VariableDeclarator[@Initializer = true, @Name = "day"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Day"] @@ -97,7 +97,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "numLetters"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "numLetters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] @@ -155,7 +155,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "j"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "j", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "j", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = true, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] @@ -173,7 +173,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "k"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] @@ -183,7 +183,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "f", @MethodName = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false] @@ -201,13 +201,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchFallthroughBranch[@Default = false] @@ -253,7 +253,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false] @@ -290,7 +290,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -318,7 +318,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "k", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.MUL, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt index f14d4f4dbd..60e675e7d9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt @@ -6,43 +6,43 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "MONDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "MONDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "TUESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TUESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "WEDNESDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "WEDNESDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "THURSDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "THURSDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "FRIDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "FRIDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SATURDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SATURDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "SUNDAY"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SUNDAY", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -54,13 +54,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "day"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "WEDNESDAY", @Name = "WEDNESDAY", @ParenthesisDepth = 0, @Parenthesized = false] +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt index e054f1877b..3564d493f9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt @@ -8,7 +8,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "yield"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "yield", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "yield", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt index 260983fffe..6a27e2f62d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt @@ -12,25 +12,25 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt index d1c329260a..f78782cd1d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt @@ -14,7 +14,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- ThrowsList[@Empty = false, @Size = 1] | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] +- Block[@Empty = false, @Size = 25, @containsComment = false] @@ -22,7 +22,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "html"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\n \n

Hello, world

\n \n\n", @Empty = false, @Image = "\"\"\"\n \n \n

Hello, world

\n \n \n \"\"\"", @Length = 66, @LiteralText = "\"\"\"\n \n \n

Hello, world

\n \n \n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -35,7 +35,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "query"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "query", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "query", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\nWHERE `CITY` = \'INDIANAPOLIS\'\nORDER BY `EMP_ID`, `LAST_NAME`;\n", @Empty = false, @Image = "\"\"\"\n SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\n WHERE `CITY` = \'INDIANAPOLIS\'\n ORDER BY `EMP_ID`, `LAST_NAME`;\n \"\"\"", @Length = 110, @LiteralText = "\"\"\"\n SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\n WHERE `CITY` = \'INDIANAPOLIS\'\n ORDER BY `EMP_ID`, `LAST_NAME`;\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -48,7 +48,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "ScriptEngine"] | +- VariableDeclarator[@Initializer = true, @Name = "engine"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "engine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "engine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "getEngineByName", @MethodName = "getEngineByName", @ParenthesisDepth = 0, @Parenthesized = false] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ScriptEngineManager"] @@ -59,7 +59,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "obj"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "eval", @MethodName = "eval", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "engine", @Name = "engine", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -68,7 +68,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "htmlWithEscapes"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "htmlWithEscapes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "htmlWithEscapes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\r\n \r\n

Hello, world

\r\n \r\n\r\n", @Empty = false, @Image = "\"\"\"\n \\r\n \\r\n

Hello, world

\\r\n \\r\n \\r\n \"\"\"", @Length = 71, @LiteralText = "\"\"\"\n \\r\n \\r\n

Hello, world

\\r\n \\r\n \\r\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -81,61 +81,61 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "season"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "season", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "season", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter", @Empty = false, @Image = "\"\"\"\n winter\"\"\"", @Length = 6, @LiteralText = "\"\"\"\n winter\"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "period"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "period", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "period", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter\n", @Empty = false, @Image = "\"\"\"\n winter\n \"\"\"", @Length = 7, @LiteralText = "\"\"\"\n winter\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi, \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @Length = 10, @LiteralText = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "salutation"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "salutation", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "salutation", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi,\n \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @Length = 11, @LiteralText = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "empty"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "empty", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "empty", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"\"\n \"\"\"", @Length = 0, @LiteralText = "\"\"\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "quote"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "quote", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "quote", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\"\n", @Empty = false, @Image = "\"\"\"\n \"\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "backslash"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "backslash", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "backslash", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\\\n", @Empty = false, @Image = "\"\"\"\n \\\\\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \\\\\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "normalStringLiteral"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "normalStringLiteral", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "normalStringLiteral", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "code"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "code", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "code", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String text = \"\"\"\n A text block inside a text block\n\"\"\";\n", @Empty = false, @Image = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @Length = 60, @LiteralText = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "text"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", @Empty = false, @Image = "\"\"\"\n Lorem ipsum dolor sit amet, consectetur adipiscing \\\n elit, sed do eiusmod tempor incididunt ut labore \\\n et dolore magna aliqua.\\\n \"\"\"", @Length = 123, @LiteralText = "\"\"\"\n Lorem ipsum dolor sit amet, consectetur adipiscing \\\n elit, sed do eiusmod tempor incididunt ut labore \\\n et dolore magna aliqua.\\\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -148,7 +148,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "colors"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "colors", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "colors", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "red \ngreen \nblue \n", @Empty = false, @Image = "\"\"\"\n red \\s\n green\\s\n blue \\s\n \"\"\"", @Length = 21, @LiteralText = "\"\"\"\n red \\s\n green\\s\n blue \\s\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -161,7 +161,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "emptyLine"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "emptyLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "emptyLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\ntest\n", @Empty = false, @Image = "\"\"\"\n\ntest\n\"\"\"", @Length = 6, @LiteralText = "\"\"\"\n\ntest\n\"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -178,7 +178,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "bs"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\\test\n", @Empty = false, @Image = "\"\"\"\n \\\\test\n \"\"\"", @Length = 6, @LiteralText = "\"\"\"\n \\\\test\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt index f92cdd9cbf..d18d380019 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalClassAndInterfaceDeclarations.txt @@ -12,13 +12,13 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "constantField"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "constantField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "constantField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Static = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = false, @Name = "staticField"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "staticField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "staticField", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "staticMethod", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] @@ -34,4 +34,4 @@ +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 1, @TrailingComma = false] +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_LOCAL, @Image = "A", @MethodName = "new", @Name = "A", @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "A", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "A", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt index 469d4d8963..ad6ad89aa2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt @@ -14,11 +14,11 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "month", @Name = "month", @ParenthesisDepth = 0, @Parenthesized = false] @@ -33,11 +33,11 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchants", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchants", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "month", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MerchantSales", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MerchantSales", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] @@ -46,11 +46,11 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "sales", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "sales", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- ReturnStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] @@ -65,7 +65,7 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MerchantSales"] | | | | +- ArgumentList[@Empty = false, @Size = 2] @@ -79,10 +79,10 @@ | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compare", @MethodName = "compare", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] @@ -114,7 +114,7 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord2", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord2", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] @@ -123,7 +123,7 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord3", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord3", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] @@ -134,7 +134,7 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord4", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord4", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] @@ -145,7 +145,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalClass", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -165,19 +165,19 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt index 260983fffe..6a27e2f62d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt @@ -12,25 +12,25 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "result"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "non"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "non", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt index 8194cb8681..dcb71151a9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt @@ -16,7 +16,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "other string", @Empty = false, @Image = "\"other string\"", @Length = 12, @LiteralText = "\"other string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "test", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -27,7 +27,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "obj"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "abc", @Empty = false, @Image = "\"abc\"", @Length = 3, @LiteralText = "\"abc\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- IfStatement[@Else = true] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -36,7 +36,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -88,7 +88,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -121,7 +121,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -147,7 +147,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -172,7 +172,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -206,7 +206,7 @@ | | | | +- Annotation[@SimpleName = "Deprecated"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -240,7 +240,7 @@ | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -275,7 +275,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] @@ -292,13 +292,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "f"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt index f7a424ed09..ed83df5ebb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt @@ -5,11 +5,11 @@ | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] +- RecordBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -21,13 +21,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt index a06d3dde50..f785ea9c4c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt @@ -36,13 +36,13 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Deprecated"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 3] | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "MyComplex", @Name = "MyComplex", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -54,11 +54,11 @@ | | | | | +- Annotation[@SimpleName = "MyAnnotation"] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -85,7 +85,7 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex$NestedClass", @CanonicalName = "Records.MyComplex.NestedClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "NestedClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -96,11 +96,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 2] | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "Range", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -133,7 +133,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "foo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "foo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 1] | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "RecordWithLambdaInCompactConstructor", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -162,7 +162,7 @@ | | | +- ArrayTypeDim[@Varargs = true] | | | +- Annotation[@SimpleName = "Nullable"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$ArrayRec", @CanonicalName = "Records.ArrayRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ArrayRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -173,7 +173,7 @@ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$EmptyRec", @CanonicalName = "Records.EmptyRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "EmptyRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -204,7 +204,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "EmptyRec"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -233,11 +233,11 @@ | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lastName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lastName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] +- ImplementsList[@Empty = false, @Size = 2] | +- ClassType[@FullyQualified = false, @SimpleName = "Person"] | +- ClassType[@FullyQualified = true, @SimpleName = "Serializable"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt index 55a5d5f606..04c76d628c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt @@ -11,7 +11,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] +- ExpressionStatement[] +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index 09c4c440bc..6ac4e6765d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -9,7 +9,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -47,7 +47,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -56,7 +56,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -89,7 +89,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -98,7 +98,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -123,7 +123,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -139,7 +139,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -153,7 +153,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -175,7 +175,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -195,7 +195,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -230,7 +230,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -280,7 +280,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 12, @containsComment = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "testStringOrDefaultNull", @MethodName = "testStringOrDefaultNull", @ParenthesisDepth = 0, @Parenthesized = false] @@ -300,7 +300,7 @@ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt index 2bc4a023cf..d9e3233e93 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -8,24 +8,24 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "j", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "EnhancedTypeCheckingSwitch$Color", @CanonicalName = "EnhancedTypeCheckingSwitch.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "typeTester", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] @@ -33,7 +33,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] @@ -51,7 +51,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -63,7 +63,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -79,7 +79,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -98,7 +98,7 @@ | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] - | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ia", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -126,13 +126,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 9, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index 5b58423b5a..1179aaa81d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -9,7 +9,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -19,7 +19,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -28,7 +28,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] | +- SwitchLabel[@Default = true] @@ -40,7 +40,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -49,7 +49,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -63,7 +63,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -98,7 +98,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- ImplementsList[@Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] | +- RecordBody[@Empty = true, @Size = 0] @@ -109,7 +109,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -119,21 +119,21 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -142,7 +142,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -151,7 +151,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -165,7 +165,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -220,7 +220,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -232,7 +232,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -244,7 +244,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 13, @containsComment = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index a09c9ddbae..e8a1e2fd9f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -9,7 +9,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -18,7 +18,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -36,7 +36,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -48,7 +48,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] @@ -76,7 +76,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -94,7 +94,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "when"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -113,7 +113,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -122,7 +122,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -140,7 +140,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -152,7 +152,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "intValue", @MethodName = "intValue", @ParenthesisDepth = 0, @Parenthesized = false] @@ -189,7 +189,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] @@ -199,7 +199,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -225,7 +225,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -247,7 +247,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -268,7 +268,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = true] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_AND, @ParenthesisDepth = 0, @Parenthesized = false] @@ -278,7 +278,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -310,7 +310,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 9, @containsComment = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] @@ -342,7 +342,7 @@ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "printStackTrace", @MethodName = "printStackTrace", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 6e0d10978e..0c169bbe95 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -8,11 +8,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -21,7 +21,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -33,11 +33,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -53,24 +53,24 @@ | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$ColoredPoint", @CanonicalName = "Jep440_RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Rectangle", @CanonicalName = "Jep440_RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -78,11 +78,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -91,7 +91,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -106,15 +106,15 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -130,7 +130,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -148,19 +148,19 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -177,11 +177,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "patternsCanFailToMatch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -192,7 +192,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -208,11 +208,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -242,11 +242,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EmptyDeclaration[] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "recordInference", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -259,7 +259,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pair", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pair", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pair", @Name = "pair", @ParenthesisDepth = 0, @Parenthesized = false] @@ -271,11 +271,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -290,7 +290,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -303,7 +303,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -322,7 +322,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -344,7 +344,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- IfStatement[@Else = false] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -359,7 +359,7 @@ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt index 3e64a5beb7..5ae7cb84b6 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -9,7 +9,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -19,7 +19,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -31,7 +31,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -43,7 +43,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -55,7 +55,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -74,7 +74,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -112,7 +112,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false] @@ -125,7 +125,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -144,7 +144,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -163,7 +163,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -179,7 +179,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "response", @Name = "response", @ParenthesisDepth = 0, @Parenthesized = false] @@ -216,7 +216,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -235,7 +235,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -254,7 +254,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -276,16 +276,16 @@ | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 4, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "CLUBS", @MethodName = "new", @Name = "CLUBS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "CLUBS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "CLUBS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "DIAMONDS", @MethodName = "new", @Name = "DIAMONDS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "DIAMONDS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "DIAMONDS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "HEARTS", @MethodName = "new", @Name = "HEARTS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEARTS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEARTS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "SPADES", @MethodName = "new", @Name = "SPADES", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SPADES", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "SPADES", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Tarot", @CanonicalName = "Jep441_PatternMatchingForSwitch.Tarot", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Tarot", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] @@ -298,7 +298,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] @@ -307,7 +307,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -327,7 +327,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -347,7 +347,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -367,7 +367,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -381,7 +381,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -397,7 +397,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] @@ -458,7 +458,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -479,10 +479,10 @@ | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 2, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "HEADS", @MethodName = "new", @Name = "HEADS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEADS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "HEADS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "TAILS", @MethodName = "new", @Name = "TAILS", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TAILS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "TAILS", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "goodEnumSwitch1", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- VoidType[] @@ -490,7 +490,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Currency"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] @@ -527,7 +527,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt index 26347cab9b..ebb71291e2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt @@ -12,19 +12,19 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 3, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = false] @@ -32,7 +32,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -44,7 +44,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -56,7 +56,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -68,7 +68,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt index bdd1ce8066..7156ae5bec 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -8,35 +8,35 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Color", @CanonicalName = "RecordPatterns.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$ColoredPoint", @CanonicalName = "RecordPatterns.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -44,11 +44,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -57,7 +57,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -66,13 +66,13 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "x", @MethodName = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -80,7 +80,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "y", @MethodName = "y", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -100,7 +100,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -112,11 +112,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -134,7 +134,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -146,11 +146,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -168,7 +168,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -183,15 +183,15 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -207,33 +207,33 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -264,7 +264,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -282,19 +282,19 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -311,11 +311,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -326,7 +326,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -342,11 +342,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -375,7 +375,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -386,7 +386,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -400,7 +400,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -420,7 +420,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -434,7 +434,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -454,7 +454,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -466,7 +466,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -488,7 +488,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -507,7 +507,7 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -529,7 +529,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- IfStatement[@Else = false] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] @@ -544,7 +544,7 @@ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "var"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt index 1d0d121f32..d78f52c68a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -34,11 +34,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -51,7 +51,7 @@ | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] | +- VariableDeclarator[@Initializer = true, @Name = "p1"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -59,7 +59,7 @@ | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] | +- VariableDeclarator[@Initializer = true, @Name = "p2"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p1", @Name = "p1", @ParenthesisDepth = 0, @Parenthesized = false] @@ -73,11 +73,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -94,11 +94,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -115,11 +115,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -138,11 +138,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -159,11 +159,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -182,11 +182,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -203,11 +203,11 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -224,11 +224,11 @@ | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "D"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index 058cbaefed..bf1fd05fd0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -19,14 +19,14 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = false, @Name = "area"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Triangle", @Name = "Triangle", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "area", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -47,7 +47,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -60,7 +60,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] @@ -92,7 +92,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -106,7 +106,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] @@ -134,7 +134,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -148,7 +148,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "calculateArea", @MethodName = "calculateArea", @ParenthesisDepth = 0, @Parenthesized = false] @@ -166,7 +166,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -191,13 +191,13 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 12, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "large"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- ArgumentList[@Empty = false, @Size = 1] @@ -206,7 +206,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "small"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] | +- ArgumentList[@Empty = false, @Size = 1] @@ -215,7 +215,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | +- VariableDeclarator[@Initializer = true, @Name = "rect"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] | +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index bcce204419..01c6a79db1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -9,7 +9,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] @@ -18,7 +18,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] @@ -43,7 +43,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -52,7 +52,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -80,7 +80,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] @@ -101,7 +101,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -110,7 +110,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "charValue", @MethodName = "charValue", @ParenthesisDepth = 0, @Parenthesized = false] @@ -165,7 +165,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] - | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 4, @containsComment = false] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "testSwitchBlock", @MethodName = "testSwitchBlock", @ParenthesisDepth = 0, @Parenthesized = false] @@ -185,7 +185,7 @@ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt index dff0ab9939..de9700bf48 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt @@ -13,15 +13,15 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -32,19 +32,19 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -57,7 +57,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -70,16 +70,16 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -96,7 +96,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -108,7 +108,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- ArgumentList[@Empty = false, @Size = 3] @@ -119,7 +119,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -137,13 +137,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- ArgumentList[@Empty = false, @Size = 1] @@ -152,7 +152,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -171,7 +171,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -189,7 +189,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -210,13 +210,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "index"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -240,7 +240,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "apples", @Empty = false, @Image = "\"apples\"", @Length = 6, @LiteralText = "\"apples\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -249,7 +249,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -275,7 +275,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -313,19 +313,19 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -338,25 +338,25 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -374,15 +374,15 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -400,7 +400,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] @@ -429,7 +429,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -527,15 +527,15 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -554,7 +554,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] @@ -583,7 +583,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -683,13 +683,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -700,7 +700,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -711,11 +711,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -726,7 +726,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -735,7 +735,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -745,7 +745,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -767,7 +767,7 @@ +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] +- Template[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index 482d1fe703..e185cc9732 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -12,35 +12,35 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -51,7 +51,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -73,11 +73,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -107,11 +107,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- UnnamedPattern[] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -156,7 +156,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -170,7 +170,7 @@ | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | | +- VariableDeclarator[@Initializer = true, @Name = "b"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -188,7 +188,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -200,7 +200,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -212,7 +212,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -225,14 +225,14 @@ | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -244,7 +244,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] @@ -259,7 +259,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -271,14 +271,14 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -304,7 +304,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] @@ -323,7 +323,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] @@ -341,20 +341,20 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "total"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- IfStatement[@Else = false] @@ -380,10 +380,10 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -407,7 +407,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | +- VariableDeclarator[@Initializer = true, @Name = "q"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -423,7 +423,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -431,7 +431,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -439,7 +439,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -447,7 +447,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -463,21 +463,21 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -485,7 +485,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] @@ -523,7 +523,7 @@ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] @@ -533,7 +533,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- TryStatement[@TryWithResources = false] | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -541,7 +541,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -558,7 +558,7 @@ | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -573,7 +573,7 @@ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -604,5 +604,5 @@ +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt index 66f34f82b4..8a67765192 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt @@ -3,7 +3,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt index 9a4174133e..8633c784a0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -12,35 +12,35 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Color", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Color", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Color", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 3, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "RED", @MethodName = "new", @Name = "RED", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "RED", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "GREEN", @MethodName = "new", @Name = "GREEN", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "GREEN", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ColoredPoint", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ColoredPoint", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ColoredPoint", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -51,7 +51,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -73,11 +73,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -107,11 +107,11 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- UnnamedPattern[] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -156,7 +156,7 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -170,7 +170,7 @@ | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] | | +- VariableDeclarator[@Initializer = true, @Name = "b"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -188,7 +188,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -200,7 +200,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -212,7 +212,7 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -225,14 +225,14 @@ | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -244,7 +244,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] @@ -259,7 +259,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] @@ -271,14 +271,14 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -304,7 +304,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] @@ -323,7 +323,7 @@ | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | +- VariableDeclarator[@Initializer = true, @Name = "LIMIT"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LIMIT", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "sideEffect", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] @@ -341,20 +341,20 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "total"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "total", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- IfStatement[@Else = false] @@ -380,10 +380,10 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sideEffect", @MethodName = "sideEffect", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -407,7 +407,7 @@ | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | +- VariableDeclarator[@Initializer = true, @Name = "q"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] @@ -423,7 +423,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -431,7 +431,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -439,7 +439,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -447,7 +447,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -463,21 +463,21 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "remove", @MethodName = "remove", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "q", @Name = "q", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -485,7 +485,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] @@ -523,7 +523,7 @@ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "_"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] @@ -533,7 +533,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- TryStatement[@TryWithResources = false] | +- Block[@Empty = false, @Size = 2, @containsComment = false] @@ -541,7 +541,7 @@ | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | +- VariableDeclarator[@Initializer = true, @Name = "i"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] @@ -558,7 +558,7 @@ | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -573,7 +573,7 @@ | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] @@ -604,5 +604,5 @@ +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = true, @Visibility = Visibility.V_PACKAGE] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NO_DATA", @Empty = false, @Image = "\"NO_DATA\"", @Length = 7, @LiteralText = "\"NO_DATA\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt index acd50b8006..5343c7db68 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt @@ -27,7 +27,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.LONG] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LE, @ParenthesisDepth = 0, @Parenthesized = false] @@ -42,7 +42,7 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "valueOf", @MethodName = "valueOf", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] @@ -63,7 +63,7 @@ | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bytes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -76,12 +76,12 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "publicKey"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "publicKey", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getPublicKey", @MethodName = "getPublicKey", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "certificate", @Name = "certificate", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -101,7 +101,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "byteArray"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "byteArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "byteArray", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "publicKey", @Name = "publicKey", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] @@ -109,7 +109,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "rsaKey", @Name = "rsaKey", @ParenthesisDepth = 0, @Parenthesized = false] @@ -123,7 +123,7 @@ | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "dsaKey", @Name = "dsaKey", @ParenthesisDepth = 0, @Parenthesized = false] @@ -155,11 +155,11 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -172,12 +172,12 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VariableDeclarator[@Initializer = true, @Name = "f"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -191,11 +191,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 3, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Range", @Name = "Range", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -203,15 +203,15 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "lo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "hi", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "maxDistance", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -255,7 +255,7 @@ +- EnumBody[@Empty = false, @SeparatorSemi = true, @Size = 4, @TrailingComma = false] +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "BLUE", @MethodName = "new", @Name = "BLUE", @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Visibility = Visibility.V_PUBLIC] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = true, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "BLUE", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_PUBLIC] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "Color", @Name = "Color", @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @containsComment = false] @@ -268,7 +268,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.LT, @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt index 969a8c9b36..632cd63f4d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt @@ -13,15 +13,15 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -32,19 +32,19 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -57,7 +57,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -70,16 +70,16 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] | | +- VariableDeclarator[@Initializer = true, @Name = "y"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "y", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -96,7 +96,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -108,7 +108,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] | | +- ArgumentList[@Empty = false, @Size = 3] @@ -119,7 +119,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -137,13 +137,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] | | +- ArgumentList[@Empty = false, @Size = 1] @@ -152,7 +152,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -171,7 +171,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -189,7 +189,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -210,13 +210,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableDeclarator[@Initializer = true, @Name = "index"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "index", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -240,7 +240,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fruit", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "apples", @Empty = false, @Image = "\"apples\"", @Length = 6, @LiteralText = "\"apples\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "oranges", @Empty = false, @Image = "\"oranges\"", @Length = 7, @LiteralText = "\"oranges\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -249,7 +249,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -275,7 +275,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -313,19 +313,19 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -338,25 +338,25 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -374,15 +374,15 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -400,7 +400,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] @@ -429,7 +429,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -527,15 +527,15 @@ | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "width", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.DOUBLE] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "height", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = false, @Size = 1] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "area", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -554,7 +554,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] - | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] @@ -583,7 +583,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "FMT", @Name = "FMT", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -683,13 +683,13 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RAW", @Name = "RAW", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -700,7 +700,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -711,11 +711,11 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "accountNumber", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "literalsInsideTemplateExpressions", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -726,7 +726,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Template[] @@ -735,7 +735,7 @@ | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] - | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] | | +- ArgumentList[@Empty = false, @Size = 2] @@ -745,7 +745,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] | +- Template[] @@ -767,7 +767,7 @@ +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] +- ClassType[@FullyQualified = false, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] - +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "STR", @Name = "STR", @ParenthesisDepth = 0, @Parenthesized = false] +- Template[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt index 66f34f82b4..8a67765192 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt @@ -3,7 +3,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt index 5b20d948df..dfbf7cebca 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt @@ -5,7 +5,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] - | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_PACKAGE] | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "asList", @MethodName = "asList", @ParenthesisDepth = 0, @Parenthesized = false] From cc17469f4e94df0e708c4ad531d0eb39b6a6c252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 16:10:37 +0200 Subject: [PATCH 052/121] Fix #4990 - Add attribute `@PackageQualifier` to ASTClassType --- .../pmd/lang/java/ast/ASTClassType.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java index cc97bc926d..05ddfc78b3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java @@ -125,6 +125,22 @@ public final class ASTClassType extends AbstractJavaTypeNode implements ASTRefer } + /** + * Return the package qualifier, if this is a fully qualified name. + * Note that this will only be the case if we could resolve the + * qualifier to a package name during disambiguation. In other words, + * if the auxclasspath is not complete, and the qualifier could not + * be disambiguated, this method will return null (and an AmbiguousName + * will stay in the tree). + */ + public @Nullable String getPackageQualifier() { + if (isFullyQualified()) { + assert symbol != null: "Symbol should be non-null if isFullyQualified returns true"; + return symbol.getPackageName(); + } + return null; + } + @Override protected R acceptVisitor(JavaVisitor visitor, P data) { return visitor.visit(this, data); From 98d455af4505cad6cc86c3655021501347fc1f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 16:13:13 +0200 Subject: [PATCH 053/121] Update references --- .../sourceforge/pmd/lang/java/ast/Bug1429.txt | 32 +- .../sourceforge/pmd/lang/java/ast/Bug1530.txt | 2 +- .../lang/java/ast/GitHubBug1780OuterClass.txt | 16 +- .../pmd/lang/java/ast/GitHubBug207.txt | 8 +- .../pmd/lang/java/ast/GitHubBug208.txt | 8 +- .../pmd/lang/java/ast/GitHubBug309.txt | 12 +- .../pmd/lang/java/ast/GitHubBug3642.txt | 2 +- .../pmd/lang/java/ast/LambdaBug1333.txt | 10 +- .../pmd/lang/java/ast/LambdaBug1470.txt | 16 +- .../pmd/lang/java/ast/LambdaBug206.txt | 8 +- .../pmd/lang/java/ast/ParserCornerCases.txt | 122 ++++---- .../pmd/lang/java/ast/ParserCornerCases17.txt | 96 +++--- .../pmd/lang/java/ast/ParserCornerCases18.txt | 294 +++++++++--------- .../pmd/lang/java/ast/SwitchStatements.txt | 2 +- .../java14/MultipleCaseLabels.txt | 10 +- .../java14/SimpleSwitchExpressions.txt | 4 +- .../java14/SwitchExpressions.txt | 34 +- .../jdkversiontests/java14/SwitchRules.txt | 12 +- .../java15/NonSealedIdentifier.txt | 4 +- .../ast/jdkversiontests/java15/TextBlocks.txt | 56 ++-- .../jdkversiontests/java16/LocalRecords.txt | 34 +- .../java16/NonSealedIdentifier.txt | 4 +- .../java16/PatternMatchingInstanceof.txt | 64 ++-- .../java/ast/jdkversiontests/java16/Point.txt | 8 +- .../ast/jdkversiontests/java16/Records.txt | 58 ++-- .../ast/jdkversiontests/java17/LocalVars.txt | 2 +- .../java17/SealedInnerClasses.txt | 12 +- .../java17/expression/Expr.txt | 8 +- .../jdkversiontests/java17/geometry/Shape.txt | 6 +- .../java17/geometry/Square.txt | 2 +- .../java21/AnnotationValueInitializers.txt | 4 +- .../java21/DealingWithNull.txt | 68 ++-- .../java21/EnhancedTypeCheckingSwitch.txt | 30 +- .../java21/ExhaustiveSwitch.txt | 104 +++---- .../java21/GuardedPatterns.txt | 66 ++-- .../java21/Jep440_RecordPatterns.txt | 116 +++---- .../Jep441_PatternMatchingForSwitch.txt | 140 ++++----- .../java21/PatternsInSwitchLabels.txt | 24 +- .../jdkversiontests/java21/RecordPatterns.txt | 166 +++++----- .../java21/RecordPatternsExhaustiveSwitch.txt | 102 +++--- .../java21/RefiningPatternsInSwitch.txt | 46 +-- .../ScopeOfPatternVariableDeclarations.txt | 36 +-- .../java21p/Jep430_StringTemplates.txt | 110 +++---- .../Jep443_UnnamedPatternsAndVariables.txt | 144 ++++----- .../java21p/Jep445_UnnamedClasses1.txt | 2 +- .../java21p/Jep445_UnnamedClasses2.txt | 4 +- .../java21p/Jep445_UnnamedClasses3.txt | 4 +- .../Jep456_UnnamedPatternsAndVariables.txt | 144 ++++----- .../java22p/Jep447_StatementsBeforeSuper.txt | 40 +-- .../java22p/Jep459_StringTemplates.txt | 110 +++---- .../java22p/Jep463_UnnamedClasses1.txt | 2 +- .../java22p/Jep463_UnnamedClasses2.txt | 4 +- .../java22p/Jep463_UnnamedClasses3.txt | 4 +- .../Jep463_UnnamedClasses4WithImports.txt | 8 +- .../java9/jdk9_module_info.txt | 12 +- .../java9/jdk9_module_info_with_annot.txt | 2 +- 56 files changed, 1219 insertions(+), 1219 deletions(-) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt index 608f1370dd..4ebff34db5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1429.txt @@ -4,16 +4,16 @@ +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "getAttributeTuples", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - +- ClassType[@FullyQualified = false, @SimpleName = "Set"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Set"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - +- ClassType[@FullyQualified = false, @SimpleName = "Set"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Set"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "attributes", @Name = "attributes", @ParenthesisDepth = 0, @Parenthesized = false] @@ -22,12 +22,12 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "emptySet", @MethodName = "emptySet", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "Collections", @Name = "Collections", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- ArgumentList[@Empty = true, @Size = 0] +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "HashSet"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "HashSet"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] +- AmbiguousName[@CompileTimeConstant = false, @Image = "CollectionUtils", @Name = "CollectionUtils", @ParenthesisDepth = 0, @Parenthesized = false] @@ -37,7 +37,7 @@ | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = true, @Size = 0] +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "Transformer"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Transformer"] +- ArgumentList[@Empty = true, @Size = 0] +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Bug1429$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -45,36 +45,36 @@ +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "transform", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- Annotation[@SimpleName = "Override"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] - +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Override"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "key"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "key", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "value"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "value", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "get", @MethodName = "get", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "attributes", @Name = "attributes", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "HGXLIFFTypeConfiguration"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "HGXLIFFTypeConfiguration"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "key", @Name = "key", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "result"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "result", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "key", @Name = "key", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt index 44e828f3a0..a15cac50cd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/Bug1530.txt @@ -11,7 +11,7 @@ +- UnaryExpression[@CompileTimeConstant = false, @Operator = UnaryOp.POST_INCREMENT, @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "currentChild", @Name = "currentChild", @ParenthesisDepth = 0, @Parenthesized = false] +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true] - +- ClassType[@FullyQualified = false, @SimpleName = "PathElement"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "PathElement"] +- MethodCall[@CompileTimeConstant = false, @Image = "getUserObject", @MethodName = "getUserObject", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodCall[@CompileTimeConstant = false, @Image = "getLastLeaf", @MethodName = "getLastLeaf", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "stack", @Name = "stack", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt index 142013490b..6756c38afe 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug1780OuterClass.txt @@ -12,7 +12,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner Class AdapterClass", @Empty = false, @Image = "\"Inner Class AdapterClass\"", @Length = 24, @LiteralText = "\"Inner Class AdapterClass\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.pmd.test.GitHubBug1780OuterClass$InnerClass", @CanonicalName = "com.pmd.test.GitHubBug1780OuterClass.InnerClass", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "com.pmd.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "InnerClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] @@ -26,13 +26,13 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner Class Constructor", @Empty = false, @Image = "\"Inner Class Constructor\"", @Length = 23, @LiteralText = "\"Inner Class Constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.pmd.test.GitHubBug1780OuterClass$StaticInnerClass", @CanonicalName = "com.pmd.test.GitHubBug1780OuterClass.StaticInnerClass", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "com.pmd.test", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "StaticInnerClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "InnerClass"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "InnerClass"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Image = "StaticInnerClass", @Name = "StaticInnerClass", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -40,14 +40,14 @@ | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = true, @Super = true, @This = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "GitHubBug1780OuterClass"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GitHubBug1780OuterClass"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "StaticInnerClass Constructor", @Empty = false, @Image = "\"StaticInnerClass Constructor\"", @Length = 28, @LiteralText = "\"StaticInnerClass Constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -56,13 +56,13 @@ +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ArrayDimensions[@Empty = false, @Size = 1] | +- ArrayTypeDim[@Varargs = false] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "StaticInnerClass"] - | +- ClassType[@FullyQualified = false, @SimpleName = "GitHubBug1780OuterClass"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StaticInnerClass"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GitHubBug1780OuterClass"] +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt index ca175c431d..446a93419c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug207.txt @@ -4,13 +4,13 @@ +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "resourceHttpMessageWriter", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC)] - +- ClassType[@FullyQualified = false, @SimpleName = "HttpMessageWriter"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "HttpMessageWriter"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Resource"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Resource"] +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = true, @SimpleName = "Context"] + | +- ClassType[@FullyQualified = true, @PackageQualifier = "BodyInserter", @SimpleName = "Context"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "context", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] @@ -20,4 +20,4 @@ +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "cast", @ParenthesisDepth = 0, @Parenthesized = false] +- AmbiguousName[@CompileTimeConstant = false, @Image = "BodyInserters", @Name = "BodyInserters", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - +- ClassType[@FullyQualified = false, @SimpleName = "Resource"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Resource"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt index 0f682c9800..7f5d07ff33 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug208.txt @@ -11,15 +11,15 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GitHubBug208$1LocalClass", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = false, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "LocalClass", @Static = false, @TopLevel = false, @Visibility = Visibility.V_LOCAL] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Lazy"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Lazy"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Lazy"] | +- Annotation[@SimpleName = "Configuration"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Configuration"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Configuration"] +- ClassBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Bean"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Bean"] - +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Bean"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt index 83f0187049..d788aa255d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug309.txt @@ -10,24 +10,24 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | +- VariableDeclarator[@Initializer = true, @Name = "r11"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Main"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Main"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - +- ClassType[@FullyQualified = false, @SimpleName = "IntFunction"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IntFunction"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | +- ArrayType[@ArrayDepth = 1] | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -42,4 +42,4 @@ | +- ArrayDimensions[@Empty = false, @Size = 1] | +- ArrayTypeDim[@Varargs = false] +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt index 7dd84d21a6..4e541cc654 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/GitHubBug3642.txt @@ -7,7 +7,7 @@ +- AnnotationTypeBody[@Empty = false, @Size = 1] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "v1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] - +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- FormalParameters[@Empty = true, @Size = 0] +- ArrayDimensions[@Empty = false, @Size = 1] +- ArrayTypeDim[@Varargs = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt index 8ed63303b7..0a27247863 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt @@ -4,14 +4,14 @@ +- ClassBody[@Empty = false, @Size = 4] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = true, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.STATIC, JModifier.FINAL)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Logger"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Logger"] | +- VariableDeclarator[@Initializer = true, @Name = "LOG"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "LOG", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- MethodCall[@CompileTimeConstant = false, @Image = "getLogger", @MethodName = "getLogger", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "LoggerFactory", @Name = "LoggerFactory", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Foo"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Foo"] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "deleteDirectoriesByNamePattern", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- VoidType[] @@ -34,10 +34,10 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Consumer"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Consumer"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = true, @UpperBound = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "consumer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] @@ -53,7 +53,7 @@ +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt index 087f538552..c574671d0b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt @@ -13,25 +13,25 @@ | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "stuff", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Observable"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Boolean"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Boolean"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "map", @MethodName = "map", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "create", @MethodName = "create", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Observable"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Subscriber"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Subscriber"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- WildcardType[@LowerBound = true, @UpperBound = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "subscriber", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] @@ -47,16 +47,16 @@ | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "false", @ParenthesisDepth = 0, @Parenthesized = false, @True = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testSuper2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Observable"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Boolean"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Boolean"] +- FormalParameters[@Empty = true, @Size = 0] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ReturnStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "map", @MethodName = "map", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodCall[@CompileTimeConstant = false, @Image = "create", @MethodName = "create", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Observable"] | +- ArgumentList[@Empty = false, @Size = 1] | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt index 4d2966d6cd..4607910ce2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug206.txt @@ -4,16 +4,16 @@ +- AnnotationTypeBody[@Empty = false, @Size = 1] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Static = true, @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] - +- ClassType[@FullyQualified = false, @SimpleName = "ThreadLocal"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ThreadLocal"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Interner"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Interner"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] +- VariableDeclarator[@Initializer = true, @Name = "interner"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PUBLIC, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "interner", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = true, @TypeInferred = false, @Visibility = Visibility.V_PUBLIC] +- MethodCall[@CompileTimeConstant = false, @Image = "withInitial", @MethodName = "withInitial", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "ThreadLocal"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ThreadLocal"] +- ArgumentList[@Empty = false, @Size = 1] +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "newStrongInterner", @ParenthesisDepth = 0, @Parenthesized = false] +- AmbiguousName[@CompileTimeConstant = false, @Image = "Interners", @Name = "Interners", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt index 8860f0dbb2..3803310cd7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases.txt @@ -13,20 +13,20 @@ | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Class"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "V"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "clazz", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "doStuff", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -42,7 +42,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Outer constructor", @Empty = false, @Image = "\"Outer constructor\"", @Length = 17, @LiteralText = "\"Outer constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Outer$Inner", @CanonicalName = "Outer.Inner", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Inner", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -56,21 +56,21 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Inner constructor", @Empty = false, @Image = "\"Inner constructor\"", @Length = 17, @LiteralText = "\"Inner constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Child", @CanonicalName = "Child", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Child", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Inner"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Outer"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Inner"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Outer"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Child", @Name = "Child", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Outer"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Outer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = true, @Super = true, @This = false] @@ -80,13 +80,13 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Child constructor", @Empty = false, @Image = "\"Child constructor\"", @Length = 17, @LiteralText = "\"Child constructor\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases", @CanonicalName = "ParserCornerCases", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ParserCornerCases", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Superclass"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Superclass"] | +- ClassBody[@Empty = false, @Size = 8] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -104,7 +104,7 @@ | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -124,16 +124,16 @@ | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "ParserCornerCases", @Name = "ParserCornerCases", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] @@ -145,42 +145,42 @@ | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "doStuff", @MethodName = "doStuff", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "foo", @Empty = false, @Image = "\"foo\"", @Length = 3, @LiteralText = "\"foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "v"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "v", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "thisGeneric", @MethodName = "thisGeneric", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "bar", @Empty = false, @Image = "\"bar\"", @Length = 3, @LiteralText = "\"bar\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "thisGeneric", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "X"] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "X"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getByteArrayClass", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Class"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -215,13 +215,13 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PmdTestChild", @CanonicalName = "PmdTestChild", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PmdTestChild", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "PmdTestParent"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "PmdTestParent"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "PmdTestChild", @Name = "PmdTestChild", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -230,19 +230,19 @@ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "PmdTestChild$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "create", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "memoryMonitor"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "memoryMonitor", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] @@ -255,7 +255,7 @@ | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "memoryMonitor", @Name = "memoryMonitor", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ReturnStatement[] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "memoryMonitor", @Name = "memoryMonitor", @ParenthesisDepth = 0, @Parenthesized = false] @@ -264,7 +264,7 @@ | +- ClassBody[@Empty = false, @Size = 1] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = false, @Name = "name"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser", @CanonicalName = "SimpleBeanUser", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] @@ -275,7 +275,7 @@ | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SimpleBean"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser", @Name = "SimpleBeanUser", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] @@ -285,7 +285,7 @@ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SimpleBean"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -299,7 +299,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SimpleBeanUser2", @CanonicalName = "SimpleBeanUser2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "SimpleBeanUser2", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBeanUser"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SimpleBeanUser"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "SimpleBeanUser2", @Name = "SimpleBeanUser2", @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -308,7 +308,7 @@ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "SimpleBean"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SimpleBean"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SimpleBeanUser2$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -332,7 +332,7 @@ | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "SuppressWarnings"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SuppressWarnings"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -353,11 +353,11 @@ | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "SuppressWarnings"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SuppressWarnings"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Iterator"] | | | +- VariableDeclarator[@Initializer = true, @Name = "it"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "it", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "iterator", @MethodName = "iterator", @ParenthesisDepth = 0, @Parenthesized = false] @@ -371,25 +371,25 @@ | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "l"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "l", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ForeachStatement[] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "SuppressWarnings"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "SuppressWarnings"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SuppressWarnings"] | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "unchecked", @Empty = false, @Image = "\"unchecked\"", @Length = 9, @LiteralText = "\"unchecked\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = false, @Name = "s"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] @@ -405,13 +405,13 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "FooBlock"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FooBlock"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Foo", @CanonicalName = "Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MyFoo"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyFoo"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Foo", @Name = "Foo", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -420,23 +420,23 @@ | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "FooBlock"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FooBlock"] | +- ArgumentList[@Empty = true, @Size = 0] | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "Foo$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "valueOf", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "object", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fish"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fish", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "salmon", @Empty = false, @Image = "\"salmon\"", @Length = 6, @LiteralText = "\"salmon\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -447,9 +447,9 @@ | +- ClassBody[@Empty = false, @Size = 1] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "iterator", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Iterator"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- IfStatement[@Else = false] @@ -462,23 +462,23 @@ | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- ConstructorCall[@AnonymousClass = true, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Iterator"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] | | +- ArgumentList[@Empty = true, @Size = 0] | | +- AnonymousClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = true, @BinaryName = "SuperTest$1", @CanonicalName = null, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "", @Static = false, @TopLevel = false, @Visibility = Visibility.V_ANONYMOUS] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ClassBody[@Empty = false, @Size = 4] | | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_ANONYMOUS, @Static = false, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Iterator"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Iterator"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] | | | +- VariableDeclarator[@Initializer = true, @Name = "wrapped"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_ANONYMOUS, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "wrapped", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "iterator", @MethodName = "iterator", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ImmutableSet"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ImmutableSet"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "hasNext", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -492,7 +492,7 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_ANONYMOUS, @Final = false, @Name = "next", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] | | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ReturnStatement[] @@ -509,7 +509,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "contains", @MethodName = "contains", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "mods", @Name = "mods", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ImmutableSet"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ImmutableSet"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "RemoveIter", @Name = "RemoveIter", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "Modification", @Name = "Modification", @ParenthesisDepth = 0, @Parenthesized = false] @@ -521,11 +521,11 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "UnsupportedOperationException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "UnsupportedOperationException"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ThrowStatement[] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "UnsupportedOperationException"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "UnsupportedOperationException"] | +- ArgumentList[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ClazzPropertyOfPrimitiveTypes", @CanonicalName = "ClazzPropertyOfPrimitiveTypes", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ClazzPropertyOfPrimitiveTypes", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -537,7 +537,7 @@ +- Block[@Empty = false, @Size = 11, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Class"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Class"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | +- WildcardType[@LowerBound = false, @UpperBound = true] | +- VariableDeclarator[@Initializer = true, @Name = "c"] @@ -628,7 +628,7 @@ +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_OR, @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "equals", @MethodName = "equals", @ParenthesisDepth = 1, @Parenthesized = true] | | +- ClassLiteral[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "clazz", @Name = "clazz", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "equals", @MethodName = "equals", @ParenthesisDepth = 1, @Parenthesized = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt index 8167c80f4a..43a40ad384 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases17.txt @@ -142,7 +142,7 @@ | +- SwitchLabel[@Default = true] | +- ThrowStatement[] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "underscoreInNumericLiterals", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -241,18 +241,18 @@ | +- NumericLiteral[@Base = 8, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "05_2", @IntLiteral = true, @Integral = true, @LiteralText = "05_2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "stringsInSwitchStatements", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "dayOfWeekArg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "dayOfWeekArg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Wednesday", @Empty = false, @Image = "\"Wednesday\"", @Length = 9, @LiteralText = "\"Wednesday\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = false, @Name = "typeOfDay"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "typeOfDay", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -302,7 +302,7 @@ | | +- SwitchLabel[@Default = true] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Invalid day of the week: ", @Empty = false, @Image = "\"Invalid day of the week: \"", @Length = 25, @LiteralText = "\"Invalid day of the week: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -321,7 +321,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "typeInferenceForGenericInstanceCreation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -331,27 +331,27 @@ | +- Block[@Empty = false, @Size = 6, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Map"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Map"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "myMap"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myMap", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "HashMap"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "HashMap"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "list"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExpressionStatement[] @@ -361,14 +361,14 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "list2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "list2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayList"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ArrayList"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExpressionStatement[] @@ -378,13 +378,13 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "list2", @Name = "list2", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "MyClass"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyClass"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | +- VariableDeclarator[@Initializer = true, @Name = "myObject"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myObject", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "MyClass"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyClass"] | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"", @Length = 0, @LiteralText = "\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -393,11 +393,11 @@ | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- ThrowsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IOException"] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "path"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "path", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo", @Empty = false, @Image = "\"/foo\"", @Length = 4, @LiteralText = "\"/foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -406,20 +406,20 @@ | | | +- Resource[@ConciseResource = false] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "BufferedReader"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BufferedReader"] | | | +- VariableDeclarator[@Initializer = true, @Name = "br"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "br", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "BufferedReader"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BufferedReader"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileReader"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileReader"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "path", @Name = "path", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "first"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "first", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "readLine", @MethodName = "readLine", @ParenthesisDepth = 0, @Parenthesized = false] @@ -427,34 +427,34 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFileName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo-out", @Empty = false, @Image = "\"/foo-out\"", @Length = 8, @LiteralText = "\"/foo-out\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipFileName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipFileName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "/foo.zip", @Empty = false, @Image = "\"/foo.zip\"", @Length = 8, @LiteralText = "\"/foo.zip\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = true, @SimpleName = "Charset"] + | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.nio.charset", @SimpleName = "Charset"] | | +- VariableDeclarator[@Initializer = true, @Name = "charset"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "charset", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "forName", @MethodName = "forName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "Charset"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.nio.charset", @SimpleName = "Charset"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "US-ASCII", @Empty = false, @Image = "\"US-ASCII\"", @Length = 8, @LiteralText = "\"US-ASCII\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = true, @SimpleName = "Path"] + | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.nio.file", @SimpleName = "Path"] | | +- VariableDeclarator[@Initializer = true, @Name = "outputFilePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "outputFilePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "get", @MethodName = "get", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "Paths"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.nio.file", @SimpleName = "Paths"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "outputFileName", @Name = "outputFileName", @ParenthesisDepth = 0, @Parenthesized = false] | +- TryStatement[@TryWithResources = true] @@ -462,22 +462,22 @@ | | +- Resource[@ConciseResource = false] | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipFile"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.util.zip", @SimpleName = "ZipFile"] | | | +- VariableDeclarator[@Initializer = true, @Name = "zf"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "zf", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipFile"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.util.zip", @SimpleName = "ZipFile"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "zipFileName", @Name = "zipFileName", @ParenthesisDepth = 0, @Parenthesized = false] | | +- Resource[@ConciseResource = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = true, @SimpleName = "BufferedWriter"] + | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.io", @SimpleName = "BufferedWriter"] | | +- VariableDeclarator[@Initializer = true, @Name = "writer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "writer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "newBufferedWriter", @MethodName = "newBufferedWriter", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "Files"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.nio.file", @SimpleName = "Files"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "outputFilePath", @Name = "outputFilePath", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "charset", @Name = "charset", @ParenthesisDepth = 0, @Parenthesized = false] @@ -486,10 +486,10 @@ | +- ForInit[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Enumeration"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Enumeration"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ZipEntry"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ZipEntry"] | | +- VariableDeclarator[@Initializer = true, @Name = "entries"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = true, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "entries", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "entries", @MethodName = "entries", @ParenthesisDepth = 0, @Parenthesized = false] @@ -501,23 +501,23 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "newLine"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "newLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getProperty", @MethodName = "getProperty", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "line.separator", @Empty = false, @Image = "\"line.separator\"", @Length = 14, @LiteralText = "\"line.separator\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "zipEntryName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zipEntryName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 1, @Parenthesized = true] - | | | | +- ClassType[@FullyQualified = true, @SimpleName = "ZipEntry"] + | | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.util.zip", @SimpleName = "ZipEntry"] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "nextElement", @MethodName = "nextElement", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "entries", @Name = "entries", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] @@ -537,29 +537,29 @@ | +- VoidType[] | +- FormalParameters[@Empty = true, @Size = 0] | +- ThrowsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "SQLException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IOException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SQLException"] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- TryStatement[@TryWithResources = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- IfStatement[@Else = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "createNewFile", @MethodName = "createNewFile", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "foo", @Empty = false, @Image = "\"foo\"", @Length = 3, @LiteralText = "\"foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "SQLException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SQLException"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = true, @Name = "ex", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- UnionType[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "IOException"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "SQLException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IOException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SQLException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ex", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt index 5def9e475a..611be9900d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt @@ -19,14 +19,14 @@ | | +- Block[@Empty = false, @Size = 24, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "endsWith", @MethodName = "endsWith", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getName", @MethodName = "getName", @ParenthesisDepth = 0, @Parenthesized = false] @@ -36,7 +36,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -52,7 +52,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java3"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -68,7 +68,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ".java", @Empty = false, @Image = "\".java\"", @Length = 5, @LiteralText = "\".java\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java4"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] @@ -111,14 +111,14 @@ | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- VariableDeclarator[@Initializer = true, @Name = "filters"] | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArrayType[@ArrayDepth = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] @@ -154,7 +154,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArrayType[@ArrayDepth = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] @@ -187,7 +187,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "q", @Empty = false, @Image = "\"q\"", @Length = 1, @LiteralText = "\"q\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "doPrivileged", @MethodName = "doPrivileged", @ParenthesisDepth = 0, @Parenthesized = false] @@ -196,14 +196,14 @@ | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getProperty", @MethodName = "getProperty", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "user.name", @Empty = false, @Image = "\"user.name\"", @Length = 9, @LiteralText = "\"user.name\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Callable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Callable"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "c"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -211,7 +211,7 @@ | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -221,14 +221,14 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Supplier"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Supplier"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "sup"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sup", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -240,7 +240,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hi", @Empty = false, @Image = "\"hi\"", @Length = 2, @LiteralText = "\"hi\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -253,9 +253,9 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Callable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Callable"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "c2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -268,11 +268,11 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -280,21 +280,21 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "hi", @Empty = false, @Image = "\"hi\"", @Length = 2, @LiteralText = "\"hi\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "run", @MethodName = "run", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r1", @Name = "r1", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparator"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Comparator"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "comparer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "comparer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -326,11 +326,11 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s2", @Name = "s2", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Button"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Button"] | | | +- VariableDeclarator[@Initializer = true, @Name = "button"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "button", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Button"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Button"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "addActionListener", @MethodName = "addActionListener", @ParenthesisDepth = 0, @Parenthesized = false] @@ -344,7 +344,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getModifiers", @MethodName = "getModifiers", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] @@ -365,21 +365,21 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "0.30", @IntLiteral = false, @Integral = false, @LiteralText = "0.30", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.3, @ValueAsFloat = 0.3, @ValueAsInt = 0, @ValueAsLong = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "BiConsumer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BiConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -387,10 +387,10 @@ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "BiConsumer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BiConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2a"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -407,26 +407,26 @@ | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "TriConsumer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "TriConsumer"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 3] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "d", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -435,11 +435,11 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "TriConsumer"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "TriConsumer"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 3] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3a"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -461,7 +461,7 @@ | +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$TriConsumer", @CanonicalName = "ParserCornerCases18.TriConsumer", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "TriConsumer", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "FunctionalInterface"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "FunctionalInterface"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FunctionalInterface"] | | +- TypeParameters[@Empty = false, @Size = 3] | | | +- TypeParameter[@Image = "A", @Name = "A", @TypeBound = false] | | | +- TypeParameter[@Image = "B", @Name = "B", @TypeBound = false] @@ -473,19 +473,19 @@ | | +- FormalParameters[@Empty = false, @Size = 3] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -495,12 +495,12 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "toDoLater", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -511,18 +511,18 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "later", @Empty = false, @Image = "\"later\"", @Length = 5, @LiteralText = "\"later\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "doPrivileged", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "PrivilegedAction"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "PrivilegedAction"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "action", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -536,7 +536,7 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "FileFilter"] | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "filters", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -545,29 +545,29 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 2] | | | +- TypeParameter[@Image = "K", @Name = "K", @TypeBound = true] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparable"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Comparable"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- WildcardType[@LowerBound = true, @UpperBound = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "K"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "K"] | | | +- TypeParameter[@Image = "V", @Name = "V", @TypeBound = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparator"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Comparator"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = true, @SimpleName = "Entry"] + | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "Map", @SimpleName = "Entry"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "K"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "K"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "V"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- IntersectionType[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Comparator"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Comparator"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = true, @SimpleName = "Entry"] + | | | | +- ClassType[@FullyQualified = true, @PackageQualifier = "Map", @SimpleName = "Entry"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "K"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Serializable"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "K"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "V"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Serializable"] | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] @@ -591,55 +591,55 @@ | | +- Block[@Empty = false, @Size = 8, @containsComment = true] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ThisExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | +- VariableDeclarator[@Initializer = true, @Name = "pc"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "pc", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r11"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r11", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toDoLater", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "pc", @Name = "pc", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Supplier"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Supplier"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "s"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- SuperExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "staticMethod", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "IntFunction"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IntFunction"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | | +- ArrayType[@ArrayDepth = 1] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] @@ -670,10 +670,10 @@ | | +- ClassBody[@Empty = false, @Size = 3] | | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Function"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Function"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = false, @Name = "theFunction"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "theFunction", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- ConstructorDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "PmdTest", @Name = "PmdTest", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] @@ -698,7 +698,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "staticMethod", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Runnable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -707,7 +707,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "run", @Empty = false, @Image = "\"run\"", @Length = 3, @LiteralText = "\"run\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "typeAnnotations", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -717,45 +717,45 @@ | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "myString"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "myString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- Annotation[@SimpleName = "NonNull"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NonNull"] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "str", @Name = "str", @ParenthesisDepth = 0, @Parenthesized = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "o"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MyObject"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyObject"] | | | +- Annotation[@SimpleName = "Interned"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Interned"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Interned"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$UnmodifiableList", @CanonicalName = "ParserCornerCases18.UnmodifiableList", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "UnmodifiableList", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | | +- ImplementsList[@Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- Annotation[@SimpleName = "Readonly"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Readonly"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Readonly"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | | +- Annotation[@SimpleName = "Readonly"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Readonly"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Readonly"] | | +- ClassBody[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "monitorTemperature", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- ThrowsList[@Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "TemperatureException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "TemperatureException"] | | | +- Annotation[@SimpleName = "Critical"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Critical"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Critical"] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ParserCornerCases18$X", @CanonicalName = "ParserCornerCases18.X", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "X", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] @@ -770,7 +770,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sorted", @MethodName = "sorted", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Stream"] + | | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Stream"] | | | | | +- ArgumentList[@Empty = false, @Size = 3] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -802,7 +802,7 @@ | | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] + | | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "X"] | | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | | +- ExpressionStatement[] | | | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -821,7 +821,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sorted", @MethodName = "sorted", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Stream"] + | | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Stream"] | | | | | +- ArgumentList[@Empty = false, @Size = 3] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -831,11 +831,11 @@ | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -855,7 +855,7 @@ | | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "a", @Name = "a", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "X"] + | | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "X"] | | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | | +- ExpressionStatement[] | | | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -878,11 +878,11 @@ | | +- Block[@Empty = false, @Size = 2, @containsComment = true] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | | +- VariableDeclarator[@Initializer = true, @Name = "request"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "request", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- ExpressionStatement[] | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] @@ -891,11 +891,11 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testWildCardWithAnnotation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] | | | +- Annotation[@SimpleName = "AnnotatedUsage"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "AnnotatedUsage"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "AnnotatedUsage"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -903,11 +903,11 @@ | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "testAnnotationsToArrayElements", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | | +- Annotation[@SimpleName = "Nullable"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -919,7 +919,7 @@ | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | | +- Annotation[@SimpleName = "Nullable"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -928,12 +928,12 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Enum"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Enum"] | | | +- Annotation[@SimpleName = "NonNull"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NonNull"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -942,9 +942,9 @@ | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | | +- Annotation[@SimpleName = "Nullable"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -952,7 +952,7 @@ | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "createNonNullArray", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- FormalParameters[@Empty = true, @Size = 0] @@ -960,18 +960,18 @@ | | +- ReturnStatement[] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayDimExpr[@Varargs = false] | | +- Annotation[@SimpleName = "NonNull"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NonNull"] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "check", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- TypeParameters[@Empty = false, @Size = 1] | | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | | +- ArrayType[@ArrayDepth = 2] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | | +- ArrayDimensions[@Empty = false, @Size = 2] | | | +- ArrayTypeDim[@Varargs = false] | | | +- ArrayTypeDim[@Varargs = false] @@ -979,14 +979,14 @@ | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | +- ArrayType[@ArrayDepth = 2] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | | | +- ArrayDimensions[@Empty = false, @Size = 2] | | | | +- ArrayTypeDim[@Varargs = false] | | | | | +- Annotation[@SimpleName = "Anno"] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Anno"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Anno"] | | | | +- ArrayTypeDim[@Varargs = false] | | | | +- Annotation[@SimpleName = "Anno"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Anno"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Anno"] | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "arr", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- IfStatement[@Else = false] @@ -996,24 +996,24 @@ | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ThrowStatement[] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NullPointerException"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- ReturnStatement[] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "arr", @Name = "arr", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "func", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Function"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Function"] | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- ReceiverParameter[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Main"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Main"] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | +- ReturnStatement[] | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Inner"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Main"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Inner"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Main"] | | +- Annotation[@SimpleName = "A"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "max", @Overridden = false, @Static = true, @Varargs = true, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.BYTE] @@ -1025,7 +1025,7 @@ | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = true] | | | | +- Annotation[@SimpleName = "NotNull"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NotNull"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NotNull"] | | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "array", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -1033,13 +1033,13 @@ | +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "ParserCornerCases18$Anno", @CanonicalName = "ParserCornerCases18.Anno", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Anno", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Retention"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Retention"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Retention"] | | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "CLASS", @Name = "CLASS", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "RetentionPolicy", @Name = "RetentionPolicy", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- Annotation[@SimpleName = "Target"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Target"] | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | +- MemberValueArrayInitializer[] @@ -1052,41 +1052,41 @@ | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "x"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "x", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 3, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- ArrayDimensions[@Empty = false, @Size = 3] | | +- ArrayDimExpr[@Varargs = false] | | | +- Annotation[@SimpleName = "NonNull"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NonNull"] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | +- ArrayDimExpr[@Varargs = false] | | | +- Annotation[@SimpleName = "Nullable"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | | +- ArrayDimExpr[@Varargs = false] | | +- Annotation[@SimpleName = "NonNull"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "NonNull"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NonNull"] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverParameter", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | | +- ReceiverParameter[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverAndOtherParameters", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- ReceiverParameter[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "methodWithReceiverParameterWithAnnotation", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -1094,18 +1094,18 @@ | | +- VoidType[] | | +- FormalParameters[@Empty = false, @Size = 1] | | | +- ReceiverParameter[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | | | | +- Annotation[@SimpleName = "AnnotatedUsage"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "AnnotatedUsage"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "AnnotatedUsage"] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "other", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "ParserCornerCases18$AnnotatedUsage", @CanonicalName = "ParserCornerCases18.AnnotatedUsage", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "AnnotatedUsage", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Target"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Target"] | | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TYPE_USE", @Name = "TYPE_USE", @ParenthesisDepth = 0, @Parenthesized = false] @@ -1118,7 +1118,7 @@ | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- FormalParameters[@Empty = true, @Size = 0] | | +- ReceiverParameter[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ParserCornerCases18"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ParserCornerCases18"] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "DefaultIterator", @CanonicalName = "DefaultIterator", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "DefaultIterator", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT), @ExplicitModifiers = ()] @@ -1131,7 +1131,7 @@ | +- FormalParameters[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "next", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "E"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] | +- FormalParameters[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "remove", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] @@ -1169,6 +1169,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"", @Length = 0, @LiteralText = "\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt index 1ee0d5297d..59a4b4df0d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/SwitchStatements.txt @@ -31,7 +31,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1", @Empty = false, @Image = "\"1\"", @Length = 1, @LiteralText = "\"1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- BreakStatement[@Label = null] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt index 918c051e17..b4453565fd 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/MultipleCaseLabels.txt @@ -51,7 +51,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -73,7 +73,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 6", @Empty = false, @Image = "\" 6\"", @Length = 3, @LiteralText = "\" 6\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- BreakStatement[@Label = null] @@ -84,7 +84,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 7", @Empty = false, @Image = "\" 7\"", @Length = 3, @LiteralText = "\" 7\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- BreakStatement[@Label = null] @@ -96,7 +96,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 8", @Empty = false, @Image = "\" 8\"", @Length = 3, @LiteralText = "\" 8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- BreakStatement[@Label = null] @@ -107,7 +107,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 9", @Empty = false, @Image = "\" 9\"", @Length = 3, @LiteralText = "\" 9\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- BreakStatement[@Label = null] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt index e60528906c..00732addf2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SimpleSwitchExpressions.txt @@ -51,7 +51,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -112,7 +112,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "printf", @MethodName = "printf", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 2] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "NumLetters: %d%n", @Empty = false, @Image = "\"NumLetters: %d%n\"", @Length = 16, @LiteralText = "\"NumLetters: %d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "numLetters", @Name = "numLetters", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt index 408ae2734d..6dac664d03 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchExpressions.txt @@ -39,19 +39,19 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 15, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Day"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Day"] | | +- VariableDeclarator[@Initializer = true, @Name = "day"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "day", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "THURSDAY", @Name = "THURSDAY", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Day"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Day"] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "day", @Name = "day", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] @@ -62,7 +62,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "6", @IntLiteral = true, @Integral = true, @LiteralText = "6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 6.0, @ValueAsFloat = 6.0, @ValueAsInt = 6, @ValueAsLong = 6] | | +- SwitchArrowBranch[@Default = false] @@ -71,7 +71,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] | | +- SwitchArrowBranch[@Default = false] @@ -81,7 +81,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] | | +- SwitchArrowBranch[@Default = false] @@ -90,7 +90,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "9", @IntLiteral = true, @Integral = true, @LiteralText = "9", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.0, @ValueAsFloat = 9.0, @ValueAsInt = 9, @ValueAsLong = 9] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -123,7 +123,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "printf", @MethodName = "printf", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "numLetters=%d%n", @Empty = false, @Image = "\"numLetters=%d%n\"", @Length = 15, @LiteralText = "\"numLetters=%d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "numLetters", @Name = "numLetters", @ParenthesisDepth = 0, @Parenthesized = false] @@ -193,13 +193,13 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "printf", @MethodName = "printf", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "j=%d%n", @Empty = false, @Image = "\"j=%d%n\"", @Length = 6, @LiteralText = "\"j=%d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "j", @Name = "j", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Foo", @Empty = false, @Image = "\"Foo\"", @Length = 3, @LiteralText = "\"Foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -226,14 +226,14 @@ | | | +- YieldStatement[] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = true, @Image = "BAZ", @Name = "BAZ", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "SwitchExpressions"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "SwitchExpressions"] | | +- SwitchFallthroughBranch[@Default = true] | | +- SwitchLabel[@Default = true] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Neither Foo nor Bar, hmmm...", @Empty = false, @Image = "\"Neither Foo nor Bar, hmmm...\"", @Length = 28, @LiteralText = "\"Neither Foo nor Bar, hmmm...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- YieldStatement[] @@ -242,7 +242,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "printf", @MethodName = "printf", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 2] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "result=%d%n", @Empty = false, @Image = "\"result=%d%n\"", @Length = 11, @LiteralText = "\"result=%d%n\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "result", @Name = "result", @ParenthesisDepth = 0, @Parenthesized = false] @@ -263,7 +263,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "one", @Empty = false, @Image = "\"one\"", @Length = 3, @LiteralText = "\"one\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] @@ -272,7 +272,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "two", @Empty = false, @Image = "\"two\"", @Length = 3, @LiteralText = "\"two\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -280,7 +280,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "many", @Empty = false, @Image = "\"many\"", @Length = 4, @LiteralText = "\"many\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "howManyExpr", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] @@ -296,7 +296,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "k", @Name = "k", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt index f14d4f4dbd..077752f4b8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/SwitchRules.txt @@ -51,7 +51,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -72,7 +72,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 6", @Empty = false, @Image = "\" 6\"", @Length = 3, @LiteralText = "\" 6\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] @@ -81,7 +81,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 7", @Empty = false, @Image = "\" 7\"", @Length = 3, @LiteralText = "\" 7\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] @@ -91,7 +91,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 8", @Empty = false, @Image = "\" 8\"", @Length = 3, @LiteralText = "\" 8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] @@ -102,12 +102,12 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " 9", @Empty = false, @Image = "\" 9\"", @Length = 3, @LiteralText = "\" 9\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = true] +- SwitchLabel[@Default = true] +- ThrowStatement[] +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt index 260983fffe..2ba1fe216b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/NonSealedIdentifier.txt @@ -9,7 +9,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -42,6 +42,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "result", @Name = "result", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt index d1c329260a..318994dc96 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java15/TextBlocks.txt @@ -11,16 +11,16 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- ThrowsList[@Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Exception"] +- Block[@Empty = false, @Size = 25, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "html"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\n \n

Hello, world

\n \n\n", @Empty = false, @Image = "\"\"\"\n \n \n

Hello, world

\n \n \n \"\"\"", @Length = 66, @LiteralText = "\"\"\"\n \n \n

Hello, world

\n \n \n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -28,12 +28,12 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "html", @Name = "html", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "query"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "query", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\nWHERE `CITY` = \'INDIANAPOLIS\'\nORDER BY `EMP_ID`, `LAST_NAME`;\n", @Empty = false, @Image = "\"\"\"\n SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\n WHERE `CITY` = \'INDIANAPOLIS\'\n ORDER BY `EMP_ID`, `LAST_NAME`;\n \"\"\"", @Length = 110, @LiteralText = "\"\"\"\n SELECT `EMP_ID`, `LAST_NAME` FROM `EMPLOYEE_TB`\n WHERE `CITY` = \'INDIANAPOLIS\'\n ORDER BY `EMP_ID`, `LAST_NAME`;\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -41,23 +41,23 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "query", @Name = "query", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "ScriptEngine"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScriptEngine"] | +- VariableDeclarator[@Initializer = true, @Name = "engine"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "engine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "getEngineByName", @MethodName = "getEngineByName", @ParenthesisDepth = 0, @Parenthesized = false] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ScriptEngineManager"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScriptEngineManager"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "js", @Empty = false, @Image = "\"js\"", @Length = 2, @LiteralText = "\"js\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "obj"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "eval", @MethodName = "eval", @ParenthesisDepth = 0, @Parenthesized = false] @@ -66,7 +66,7 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "function hello() {\n print(\'\"Hello, world\"\');\n}\n\nhello();\n", @Empty = false, @Image = "\"\"\"\n function hello() {\n print(\'\"Hello, world\"\');\n }\n \n hello();\n \"\"\"", @Length = 60, @LiteralText = "\"\"\"\n function hello() {\n print(\'\"Hello, world\"\');\n }\n \n hello();\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "htmlWithEscapes"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "htmlWithEscapes", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\r\n \r\n

Hello, world

\r\n \r\n\r\n", @Empty = false, @Image = "\"\"\"\n \\r\n \\r\n

Hello, world

\\r\n \\r\n \\r\n \"\"\"", @Length = 71, @LiteralText = "\"\"\"\n \\r\n \\r\n

Hello, world

\\r\n \\r\n \\r\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -74,66 +74,66 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "htmlWithEscapes", @Name = "htmlWithEscapes", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "season"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "season", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter", @Empty = false, @Image = "\"\"\"\n winter\"\"\"", @Length = 6, @LiteralText = "\"\"\"\n winter\"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "period"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "period", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "winter\n", @Empty = false, @Image = "\"\"\"\n winter\n \"\"\"", @Length = 7, @LiteralText = "\"\"\"\n winter\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi, \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @Length = 10, @LiteralText = "\"\"\"\n Hi, \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "salutation"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "salutation", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hi,\n \"Bob\"\n", @Empty = false, @Image = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @Length = 11, @LiteralText = "\"\"\"\n Hi,\n \"Bob\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "empty"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "empty", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = true, @Image = "\"\"\"\n \"\"\"", @Length = 0, @LiteralText = "\"\"\"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "quote"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "quote", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\"\n", @Empty = false, @Image = "\"\"\"\n \"\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \"\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "backslash"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "backslash", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\\\n", @Empty = false, @Image = "\"\"\"\n \\\\\n \"\"\"", @Length = 2, @LiteralText = "\"\"\"\n \\\\\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "normalStringLiteral"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "normalStringLiteral", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "code"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "code", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String text = \"\"\"\n A text block inside a text block\n\"\"\";\n", @Empty = false, @Image = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @Length = 60, @LiteralText = "\"\"\"\n String text = \\\"\"\"\n A text block inside a text block\n \\\"\"\";\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "text"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", @Empty = false, @Image = "\"\"\"\n Lorem ipsum dolor sit amet, consectetur adipiscing \\\n elit, sed do eiusmod tempor incididunt ut labore \\\n et dolore magna aliqua.\\\n \"\"\"", @Length = 123, @LiteralText = "\"\"\"\n Lorem ipsum dolor sit amet, consectetur adipiscing \\\n elit, sed do eiusmod tempor incididunt ut labore \\\n et dolore magna aliqua.\\\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -141,12 +141,12 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "text", @Name = "text", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "colors"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "colors", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "red \ngreen \nblue \n", @Empty = false, @Image = "\"\"\"\n red \\s\n green\\s\n blue \\s\n \"\"\"", @Length = 21, @LiteralText = "\"\"\"\n red \\s\n green\\s\n blue \\s\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -154,12 +154,12 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "colors", @Name = "colors", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "emptyLine"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "emptyLine", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\ntest\n", @Empty = false, @Image = "\"\"\"\n\ntest\n\"\"\"", @Length = 6, @LiteralText = "\"\"\"\n\ntest\n\"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -167,7 +167,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "replaceAll", @MethodName = "replaceAll", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "emptyLine", @Name = "emptyLine", @ParenthesisDepth = 0, @Parenthesized = false] @@ -176,7 +176,7 @@ | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "", @Empty = false, @Image = "\"\"", @Length = 4, @LiteralText = "\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "bs"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "bs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "\\test\n", @Empty = false, @Image = "\"\"\"\n \\\\test\n \"\"\"", @Length = 6, @LiteralText = "\"\"\"\n \\\\test\n \"\"\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = true] @@ -184,7 +184,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "replaceAll", @MethodName = "replaceAll", @ParenthesisDepth = 0, @Parenthesized = false] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bs", @Name = "bs", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt index 469d4d8963..a21f2772dc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt @@ -13,7 +13,7 @@ | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Merchant"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -24,15 +24,15 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "month", @Name = "month", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "findTopMerchants", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Merchant"] | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Merchant"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "merchants", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -45,7 +45,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Merchant"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Merchant"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -67,7 +67,7 @@ | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "merchant", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MerchantSales"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MerchantSales"] | | | | +- ArgumentList[@Empty = false, @Size = 2] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "merchant", @Name = "merchant", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "computeSales", @MethodName = "computeSales", @ParenthesisDepth = 0, @Parenthesized = false] @@ -85,7 +85,7 @@ | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = true, @LocalVariable = false, @Name = "m2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "compare", @MethodName = "compare", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "sales", @MethodName = "sales", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "m2", @Name = "m2", @ParenthesisDepth = 0, @Parenthesized = false] @@ -96,11 +96,11 @@ | | +- ArgumentList[@Empty = false, @Size = 1] | | +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "merchant", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MerchantSales"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MerchantSales"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "toList", @MethodName = "toList", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Collectors"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalRecordAndModifiers", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -113,7 +113,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] @@ -122,29 +122,29 @@ | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord3", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord3", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Deprecated"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] | | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordBody[@Empty = true, @Size = 0] | +- LocalClassStatement[] | +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "LocalRecords$1MyRecord4", @CanonicalName = null, @EffectiveVisibility = Visibility.V_LOCAL, @Enum = false, @Final = true, @Interface = false, @Local = true, @Nested = false, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyRecord4", @Static = true, @TopLevel = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | | +- Annotation[@SimpleName = "Deprecated"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "methodWithLocalClass", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -189,6 +189,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "result", @Name = "result", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt index 260983fffe..2ba1fe216b 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/NonSealedIdentifier.txt @@ -9,7 +9,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -42,6 +42,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "result", @Name = "result", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt index 8194cb8681..3302c1f3b9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/PatternMatchingInstanceof.txt @@ -14,7 +14,7 @@ +- ClassBody[@Empty = false, @Size = 5] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "other string", @Empty = false, @Image = "\"other string\"", @Length = 12, @LiteralText = "\"other string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -25,7 +25,7 @@ | +- Block[@Empty = false, @Size = 8, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "obj"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "abc", @Empty = false, @Image = "\"abc\"", @Length = 3, @LiteralText = "\"abc\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -35,14 +35,14 @@ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 3, @containsComment = false] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a) obj == s: ", @Empty = false, @Image = "\"a) obj == s: \"", @Length = 13, @LiteralText = "\"a) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -57,7 +57,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -73,7 +73,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b) obj == s: ", @Empty = false, @Image = "\"b) obj == s: \"", @Length = 13, @LiteralText = "\"b) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -87,14 +87,14 @@ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "c) obj == s: ", @Empty = false, @Image = "\"c) obj == s: \"", @Length = 13, @LiteralText = "\"c) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -106,7 +106,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "d) obj == s: ", @Empty = false, @Image = "\"d) obj == s: \"", @Length = 13, @LiteralText = "\"d) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -120,7 +120,7 @@ | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -132,7 +132,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "e) obj == s: ", @Empty = false, @Image = "\"e) obj == s: \"", @Length = 13, @LiteralText = "\"e) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -146,7 +146,7 @@ | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -158,7 +158,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "f) obj == s: ", @Empty = false, @Image = "\"f) obj == s: \"", @Length = 13, @LiteralText = "\"f) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -171,14 +171,14 @@ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "g) obj == s: ", @Empty = false, @Image = "\"g) obj == s: \"", @Length = 13, @LiteralText = "\"g) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -190,7 +190,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "h) obj == s: ", @Empty = false, @Image = "\"h) obj == s: \"", @Length = 13, @LiteralText = "\"h) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -204,15 +204,15 @@ | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | +- Annotation[@SimpleName = "Deprecated"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "i) obj == s: ", @Empty = false, @Image = "\"i) obj == s: \"", @Length = 13, @LiteralText = "\"i) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -224,7 +224,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "j) obj == s: ", @Empty = false, @Image = "\"j) obj == s: \"", @Length = 13, @LiteralText = "\"j) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -238,15 +238,15 @@ | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | | | +- Annotation[@SimpleName = "Deprecated"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = true] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "k) obj == s: ", @Empty = false, @Image = "\"k) obj == s: \"", @Length = 13, @LiteralText = "\"k) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -258,7 +258,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "l) obj == s: ", @Empty = false, @Image = "\"l) obj == s: \"", @Length = 13, @LiteralText = "\"l) obj == s: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -272,7 +272,7 @@ | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -280,7 +280,7 @@ | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "test", @MethodName = "test", @ParenthesisDepth = 0, @Parenthesized = false] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "PatternMatchingInstanceof"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "PatternMatchingInstanceof"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ArgumentList[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof$Foo", @CanonicalName = "PatternMatchingInstanceof.Foo", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Foo", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -290,28 +290,28 @@ | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableDeclarator[@Initializer = true, @Name = "f"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Foo"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Foo"] | +- Annotation[@SimpleName = "Nullable"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "PatternMatchingInstanceof$Nullable", @CanonicalName = "PatternMatchingInstanceof.Nullable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nullable", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "Target"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Target"] | +- AnnotationMemberList[@Empty = false, @Size = 1] | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TYPE_USE", @Name = "TYPE_USE", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ElementType"] +- AnnotationTypeBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt index f7a424ed09..306c728a1e 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Point.txt @@ -18,18 +18,18 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 2, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] @@ -37,7 +37,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "p = ", @Empty = false, @Image = "\"p = \"", @Length = 4, @LiteralText = "\"p = \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt index a06d3dde50..348a6346e4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt @@ -9,26 +9,26 @@ +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Records$Nullable", @CanonicalName = "Records.Nullable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Nullable", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "Target"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Target"] | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TYPE_USE", @Name = "TYPE_USE", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ElementType"] | +- AnnotationTypeBody[@Empty = true, @Size = 0] +- AnnotationTypeDeclaration[@Abstract = true, @Annotation = true, @Anonymous = false, @BinaryName = "Records$MyAnnotation", @CanonicalName = "Records.MyAnnotation", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyAnnotation", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "Target"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Target"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Target"] | | +- AnnotationMemberList[@Empty = false, @Size = 1] | | +- MemberValuePair[@Image = "value", @Name = "value", @Shorthand = true] | | +- MemberValueArrayInitializer[] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "CONSTRUCTOR", @Name = "CONSTRUCTOR", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ElementType"] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "PARAMETER", @Name = "PARAMETER", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ElementType"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ElementType"] | +- AnnotationTypeBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$MyComplex", @CanonicalName = "Records.MyComplex", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyComplex", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -40,19 +40,19 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Deprecated"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "imaginary", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 3] | +- ConstructorDeclaration[@Abstract = false, @Arity = 2, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Image = "MyComplex", @Name = "MyComplex", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "MyAnnotation"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyAnnotation"] | | +- FormalParameters[@Empty = false, @Size = 2] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | | | | +- Annotation[@SimpleName = "MyAnnotation"] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyAnnotation"] | | | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "real", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] @@ -66,7 +66,7 @@ | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "100", @IntLiteral = true, @Integral = true, @LiteralText = "100", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 100.0, @ValueAsFloat = 100.0, @ValueAsInt = 100, @ValueAsLong = 100] | | | +- ThrowStatement[] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "too big", @Empty = false, @Image = "\"too big\"", @Length = 7, @LiteralText = "\"too big\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ExpressionStatement[] @@ -105,7 +105,7 @@ | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "Range", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "MyAnnotation"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyAnnotation"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -113,11 +113,11 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d)", @Empty = false, @Image = "\"(%d,%d)\"", @Length = 7, @LiteralText = "\"(%d,%d)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] @@ -132,7 +132,7 @@ | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "foo", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = false, @Size = 1] | +- CompactConstructorDeclaration[@EffectiveVisibility = Visibility.V_PUBLIC, @Image = "RecordWithLambdaInCompactConstructor", @Visibility = Visibility.V_PUBLIC] @@ -141,7 +141,7 @@ | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "requireNonNull", @MethodName = "requireNonNull", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Objects"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Objects"] | +- ArgumentList[@Empty = false, @Size = 2] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "foo", @Name = "foo", @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] @@ -153,15 +153,15 @@ | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = true, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] | | | +- Annotation[@SimpleName = "Nullable"] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | | +- Annotation[@SimpleName = "Deprecated"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = true] | | | +- Annotation[@SimpleName = "Nullable"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Nullable"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Nullable"] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$ArrayRec", @CanonicalName = "Records.ArrayRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "ArrayRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] @@ -188,7 +188,7 @@ | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "bar", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Type"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Type"] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] @@ -200,20 +200,20 @@ | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "EmptyRec"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "EmptyRec"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "EmptyRec"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "EmptyRec"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Records$Person", @CanonicalName = "Records.Person", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Person", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] @@ -221,24 +221,24 @@ | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "firstName", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- FormalParameters[@Empty = true, @Size = 0] | +- MethodDeclaration[@Abstract = true, @Arity = 0, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @Name = "lastName", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.ABSTRACT), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$PersonRecord", @CanonicalName = "Records.PersonRecord", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "PersonRecord", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lastName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] +- ImplementsList[@Empty = false, @Size = 2] - | +- ClassType[@FullyQualified = false, @SimpleName = "Person"] - | +- ClassType[@FullyQualified = true, @SimpleName = "Serializable"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Person"] + | +- ClassType[@FullyQualified = true, @PackageQualifier = "java.io", @SimpleName = "Serializable"] +- RecordBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt index 55a5d5f606..19eb33f3ac 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/LocalVars.txt @@ -9,7 +9,7 @@ +- Block[@Empty = false, @Size = 2, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "sealed"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sealed", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt index 03417524db..77a23617b0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/SealedInnerClasses.txt @@ -5,22 +5,22 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square", @CanonicalName = "SealedInnerClasses.Square", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Square", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED), @ExplicitModifiers = (JModifier.SEALED)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Squircle"] | +- ClassBody[@Empty = false, @Size = 2] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$OtherSquare", @CanonicalName = "SealedInnerClasses.Square.OtherSquare", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "OtherSquare", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.NON_SEALED), @ExplicitModifiers = (JModifier.PRIVATE, JModifier.NON_SEALED)] | | +- ExtendsList[@Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Square"] | | +- ClassBody[@Empty = true, @Size = 0] | +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Square$StaticClass", @CanonicalName = "SealedInnerClasses.Square.StaticClass", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "StaticClass", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.NON_SEALED, JModifier.STATIC), @ExplicitModifiers = (JModifier.NON_SEALED, JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Squircle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Squircle"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "SealedInnerClasses$Squircle", @CanonicalName = "SealedInnerClasses.Squircle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Squircle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 2] - | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] - | +- ClassType[@FullyQualified = false, @SimpleName = "StaticClass"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Square"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StaticClass"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Square"] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt index 016661bb86..47782af672 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/expression/Expr.txt @@ -4,8 +4,8 @@ +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.expression.Expr", @CanonicalName = "com.example.expression.Expr", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = false, @PackageName = "com.example.expression", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Expr", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 4] - | +- ClassType[@FullyQualified = false, @SimpleName = "ConstantExpr"] - | +- ClassType[@FullyQualified = false, @SimpleName = "PlusExpr"] - | +- ClassType[@FullyQualified = false, @SimpleName = "TimesExpr"] - | +- ClassType[@FullyQualified = false, @SimpleName = "NegExpr"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ConstantExpr"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "PlusExpr"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "TimesExpr"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NegExpr"] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt index f66d9db66f..024664a52f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Shape.txt @@ -4,7 +4,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.geometry.Shape", @CanonicalName = "com.example.geometry.Shape", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.example.geometry", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Shape", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.SEALED), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.SEALED)] +- PermitsList[@Empty = false, @Size = 3] - | +- ClassType[@FullyQualified = false, @SimpleName = "Circle"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Square"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Circle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Square"] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt index f5fe375c73..5d6acc3fd0 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java17/geometry/Square.txt @@ -4,5 +4,5 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "com.example.geometry.Square", @CanonicalName = "com.example.geometry.Square", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "com.example.geometry", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Square", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PUBLIC] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.NON_SEALED), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.NON_SEALED)] +- ExtendsList[@Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] +- ClassBody[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt index ac3fa81e26..3ae05113d2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/AnnotationValueInitializers.txt @@ -2,7 +2,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers", @CanonicalName = "AnnotationValueInitializers", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- Annotation[@SimpleName = "MyAnnotation"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyAnnotation"] | | +- AnnotationMemberList[@Empty = false, @Size = 2] | | +- MemberValuePair[@Image = "a", @Name = "a", @Shorthand = false] | | | +- MemberValueArrayInitializer[] @@ -13,7 +13,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "AnnotationValueInitializers2", @CanonicalName = "AnnotationValueInitializers2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "AnnotationValueInitializers2", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- Annotation[@SimpleName = "MyAnnotation"] - | +- ClassType[@FullyQualified = false, @SimpleName = "MyAnnotation"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyAnnotation"] | +- AnnotationMemberList[@Empty = false, @Size = 2] | +- MemberValuePair[@Image = "a", @Name = "a", @Shorthand = false] | | +- MemberValueArrayInitializer[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt index 09c4c440bc..7e8688739a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/DealingWithNull.txt @@ -8,7 +8,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -19,7 +19,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] @@ -29,7 +29,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -37,7 +37,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -46,7 +46,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -55,12 +55,12 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -71,7 +71,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -79,7 +79,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringOrDefaultNull", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -88,7 +88,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -97,12 +97,12 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -113,7 +113,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null or default case", @Empty = false, @Image = "\"null or default case\"", @Length = 20, @LiteralText = "\"null or default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -122,7 +122,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -132,18 +132,18 @@ | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NullPointerException"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String: ", @Empty = false, @Image = "\"String: \"", @Length = 8, @LiteralText = "\"String: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -152,12 +152,12 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -165,7 +165,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default", @Empty = false, @Image = "\"default\"", @Length = 7, @LiteralText = "\"default\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test3", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -174,7 +174,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -186,7 +186,7 @@ | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- BreakStatement[@Label = null] @@ -194,13 +194,13 @@ | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- BreakStatement[@Label = null] @@ -210,7 +210,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- BreakStatement[@Label = null] @@ -222,19 +222,19 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- SwitchArrowBranch[@Default = true] @@ -242,7 +242,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -256,7 +256,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -267,7 +267,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "The rest (including null)", @Empty = false, @Image = "\"The rest (including null)\"", @Length = 25, @LiteralText = "\"The rest (including null)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -277,7 +277,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -299,14 +299,14 @@ | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NullPointerException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt index 2bc4a023cf..42f6c252f1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/EnhancedTypeCheckingSwitch.txt @@ -32,7 +32,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -43,31 +43,31 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null", @Empty = false, @Image = "\"null\"", @Length = 4, @LiteralText = "\"null\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String", @Empty = false, @Image = "\"String\"", @Length = 6, @LiteralText = "\"String\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Color: ", @Empty = false, @Image = "\"Color: \"", @Length = 7, @LiteralText = "\"Color: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -78,12 +78,12 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Record class: ", @Empty = false, @Image = "\"Record class: \"", @Length = 14, @LiteralText = "\"Record class: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -102,7 +102,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Array of ints of length", @Empty = false, @Image = "\"Array of ints of length\"", @Length = 23, @LiteralText = "\"Array of ints of length\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -113,7 +113,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Something else", @Empty = false, @Image = "\"Something else\"", @Length = 14, @LiteralText = "\"Something else\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -123,14 +123,14 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 9, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "test", @Empty = false, @Image = "\"test\"", @Length = 4, @LiteralText = "\"test\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -143,7 +143,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "BLUE", @Name = "BLUE", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] +- ExpressionStatement[] | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] @@ -165,7 +165,7 @@ | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "7", @IntLiteral = true, @Integral = true, @LiteralText = "7", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.0, @ValueAsFloat = 7.0, @ValueAsInt = 7, @ValueAsLong = 7] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "8", @IntLiteral = true, @Integral = true, @LiteralText = "8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 8.0, @ValueAsFloat = 8.0, @ValueAsInt = 8, @ValueAsLong = 8] @@ -177,7 +177,7 @@ | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "typeTester", @MethodName = "typeTester", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt index 5b58423b5a..875c48bf6f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ExhaustiveSwitch.txt @@ -8,7 +8,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -18,7 +18,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -27,7 +27,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- SwitchArrowBranch[@Default = true] @@ -39,7 +39,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -48,13 +48,13 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- BreakStatement[@Label = null] @@ -62,13 +62,13 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ExpressionStatement[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Integer", @Empty = false, @Image = "\"Integer\"", @Length = 7, @LiteralText = "\"Integer\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- BreakStatement[@Label = null] @@ -78,19 +78,19 @@ +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$S", @CanonicalName = "ExhaustiveSwitch.S", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "S", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$A", @CanonicalName = "ExhaustiveSwitch.A", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "A", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$B", @CanonicalName = "ExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$C", @CanonicalName = "ExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "C", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -100,7 +100,7 @@ | | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -108,7 +108,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -118,21 +118,21 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "switchStatementExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -141,7 +141,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -150,13 +150,13 @@ | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A", @Empty = false, @Image = "\"A\"", @Length = 1, @LiteralText = "\"A\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- BreakStatement[@Label = null] @@ -164,13 +164,13 @@ | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ExpressionStatement[] | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C", @Empty = false, @Image = "\"C\"", @Length = 1, @LiteralText = "\"C\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- BreakStatement[@Label = null] @@ -180,7 +180,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case, should be B", @Empty = false, @Image = "\"default case, should be B\"", @Length = 25, @LiteralText = "\"default case, should be B\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- BreakStatement[@Label = null] @@ -190,26 +190,26 @@ | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = false] | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "E"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "E"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$E", @CanonicalName = "ExhaustiveSwitch.E", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "E", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "X", @Name = "X", @TypeBound = false] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "ExhaustiveSwitch$F", @CanonicalName = "ExhaustiveSwitch.F", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "F", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.STATIC, JModifier.FINAL)] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "Y", @Name = "Y", @TypeBound = false] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Y"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Y"] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testGenericSealedExhaustive", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -217,9 +217,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -229,9 +229,9 @@ | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "bi", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -241,7 +241,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -250,7 +250,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -259,7 +259,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] @@ -268,12 +268,12 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "coverage", @MethodName = "coverage", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] @@ -287,79 +287,79 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "coverageStatement", @MethodName = "coverageStatement", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A:", @Empty = false, @Image = "\"A:\"", @Length = 2, @LiteralText = "\"A:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "B:", @Empty = false, @Image = "\"B:\"", @Length = 2, @LiteralText = "\"B:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "C:", @Empty = false, @Image = "\"C:\"", @Length = 2, @LiteralText = "\"C:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "testSealedExhaustive", @MethodName = "testSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "switchStatementExhaustive", @MethodName = "switchStatementExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "F:", @Empty = false, @Image = "\"F:\"", @Length = 2, @LiteralText = "\"F:\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodCall[@CompileTimeConstant = false, @Image = "testGenericSealedExhaustive", @MethodName = "testGenericSealedExhaustive", @ParenthesisDepth = 0, @Parenthesized = false] +- ArgumentList[@Empty = false, @Size = 1] +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - +- ClassType[@FullyQualified = false, @SimpleName = "F"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt index a09c9ddbae..d3768d2cb1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/GuardedPatterns.txt @@ -8,7 +8,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -17,7 +17,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -28,26 +28,26 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -58,7 +58,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -66,7 +66,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -75,14 +75,14 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "when", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testIdentifierWhen", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -100,7 +100,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "when", @Name = "when", @ParenthesisDepth = 0, @Parenthesized = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "GuardedPatterns$when", @CanonicalName = "GuardedPatterns.when", @EffectiveVisibility = Visibility.V_PRIVATE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "when", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PRIVATE] @@ -112,7 +112,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -121,7 +121,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 1, @Parenthesized = true] @@ -132,26 +132,26 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "single char string", @Empty = false, @Image = "\"single char string\"", @Length = 18, @LiteralText = "\"single char string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "string", @Empty = false, @Image = "\"string\"", @Length = 6, @LiteralText = "\"string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -162,7 +162,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "integer 1", @Empty = false, @Image = "\"integer 1\"", @Length = 9, @LiteralText = "\"integer 1\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] @@ -171,7 +171,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null!", @Empty = false, @Image = "\"null!\"", @Length = 5, @LiteralText = "\"null!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -179,7 +179,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "default case", @Empty = false, @Image = "\"default case\"", @Length = 12, @LiteralText = "\"default case\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "instanceOfPattern", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -188,7 +188,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- IfStatement[@Else = false] @@ -198,7 +198,7 @@ | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -210,7 +210,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least two characters", @Empty = false, @Image = "\"A string containing at least two characters\"", @Length = 43, @LiteralText = "\"A string containing at least two characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- IfStatement[@Else = false] @@ -224,7 +224,7 @@ | | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -236,7 +236,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least three characters", @Empty = false, @Image = "\"A string containing at least three characters\"", @Length = 45, @LiteralText = "\"A string containing at least three characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- IfStatement[@Else = false] @@ -246,7 +246,7 @@ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 1, @Parenthesized = true] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -258,7 +258,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A string containing at least four characters", @Empty = false, @Image = "\"A string containing at least four characters\"", @Length = 44, @LiteralText = "\"A string containing at least four characters\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testScopeOfPatternVariableDeclarations", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -267,7 +267,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = true] @@ -277,7 +277,7 @@ | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "length", @MethodName = "length", @ParenthesisDepth = 0, @Parenthesized = false] @@ -289,7 +289,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false] @@ -297,7 +297,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a string", @Empty = false, @Image = "\"Not a string\"", @Length = 12, @LiteralText = "\"Not a string\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -307,7 +307,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -341,7 +341,7 @@ | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "NullPointerException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NullPointerException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt index 6e0d10978e..a87af875fe 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep440_RecordPatterns.txt @@ -20,7 +20,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -28,7 +28,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "obj", @Name = "obj", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -43,7 +43,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -65,11 +65,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Rectangle", @CanonicalName = "Jep440_RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -77,11 +77,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printColorOfUpperLeftPoint", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -90,7 +90,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -98,29 +98,29 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printXCoordOfUpperLeftPointWithPatterns", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -129,7 +129,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -137,36 +137,36 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -176,11 +176,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "patternsCanFailToMatch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -190,11 +190,11 @@ | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] @@ -203,22 +203,22 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -230,7 +230,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$MyPair", @CanonicalName = "Jep440_RecordPatterns.MyPair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "MyPair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -241,11 +241,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "S"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "S"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "fst", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "snd", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- EmptyDeclaration[] @@ -255,10 +255,10 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyPair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 2] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "pair", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -266,20 +266,20 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "MyPair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "MyPair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "f", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "matched", @Empty = false, @Image = "\"matched\"", @Length = 7, @LiteralText = "\"matched\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep440_RecordPatterns$Box", @CanonicalName = "Jep440_RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -289,7 +289,7 @@ | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -298,11 +298,11 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -310,25 +310,25 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -339,11 +339,11 @@ +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bbs", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- IfStatement[@Else = false] @@ -351,21 +351,21 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bbs", @Name = "bbs", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- RecordPattern[] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- RecordPattern[] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt index 3e64a5beb7..4914633be5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/Jep441_PatternMatchingForSwitch.txt @@ -4,11 +4,11 @@ +- ClassBody[@Empty = false, @Size = 13] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "formatterPatternSwitch", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -18,11 +18,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] @@ -30,11 +30,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] @@ -42,11 +42,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] @@ -54,11 +54,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -73,7 +73,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -84,7 +84,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Oops", @Empty = false, @Image = "\"Oops\"", @Length = 4, @LiteralText = "\"Oops\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] @@ -94,7 +94,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Great", @Empty = false, @Image = "\"Great\"", @Length = 5, @LiteralText = "\"Great\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -102,7 +102,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ok", @Empty = false, @Image = "\"Ok\"", @Length = 2, @LiteralText = "\"Ok\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringNew", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -111,7 +111,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -124,7 +124,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] @@ -136,14 +136,14 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] @@ -155,21 +155,21 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Sorry?", @Empty = false, @Image = "\"Sorry?\"", @Length = 6, @LiteralText = "\"Sorry?\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testStringEnhanced", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -178,7 +178,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "response", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -196,7 +196,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] @@ -208,14 +208,14 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] @@ -227,14 +227,14 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "You got it", @Empty = false, @Image = "\"You got it\"", @Length = 10, @LiteralText = "\"You got it\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "equalsIgnoreCase", @MethodName = "equalsIgnoreCase", @ParenthesisDepth = 0, @Parenthesized = false] @@ -246,33 +246,33 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Shame", @Empty = false, @Image = "\"Shame\"", @Length = 5, @LiteralText = "\"Shame\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Sorry?", @Empty = false, @Image = "\"Sorry?\"", @Length = 6, @LiteralText = "\"Sorry?\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$CardClassification", @CanonicalName = "Jep441_PatternMatchingForSwitch.CardClassification", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "CardClassification", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Tarot"] | +- ClassBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Suit", @CanonicalName = "Jep441_PatternMatchingForSwitch.Suit", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Suit", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "CardClassification"] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 4, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "CLUBS", @MethodName = "new", @Name = "CLUBS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -289,7 +289,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Tarot", @CanonicalName = "Jep441_PatternMatchingForSwitch.Tarot", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Tarot", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "CardClassification"] | +- ClassBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exhaustiveSwitchWithoutEnumSupport", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] @@ -297,7 +297,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "CardClassification"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -306,88 +306,88 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "CLUBS", @Name = "CLUBS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "DIAMONDS", @Name = "DIAMONDS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEARTS", @Name = "HEARTS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @Empty = false, @Image = "\"It\'s a tarot\"", @Length = 12, @LiteralText = "\"It\'s a tarot\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "exhaustiveSwitchWithBetterEnumSupport", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -396,7 +396,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "CardClassification"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "CardClassification"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -405,77 +405,77 @@ | | +- SwitchLabel[@Default = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "CLUBS", @Name = "CLUBS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s clubs", @Empty = false, @Image = "\"It\'s clubs\"", @Length = 10, @LiteralText = "\"It\'s clubs\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "DIAMONDS", @Name = "DIAMONDS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s diamonds", @Empty = false, @Image = "\"It\'s diamonds\"", @Length = 13, @LiteralText = "\"It\'s diamonds\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEARTS", @Name = "HEARTS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s hearts", @Empty = false, @Image = "\"It\'s hearts\"", @Length = 11, @LiteralText = "\"It\'s hearts\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "SPADES", @Name = "SPADES", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Suit"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Suit"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s spades", @Empty = false, @Image = "\"It\'s spades\"", @Length = 11, @LiteralText = "\"It\'s spades\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Tarot"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Tarot"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "It\'s a tarot", @Empty = false, @Image = "\"It\'s a tarot\"", @Length = 12, @LiteralText = "\"It\'s a tarot\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Currency", @CanonicalName = "Jep441_PatternMatchingForSwitch.Currency", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "Currency", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"] | +- ClassBody[@Empty = true, @Size = 0] +- EnumDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep441_PatternMatchingForSwitch$Coin", @CanonicalName = "Jep441_PatternMatchingForSwitch.Coin", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = true, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = false, @SimpleName = "Coin", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Currency"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Currency"] | +- EnumBody[@Empty = false, @SeparatorSemi = false, @Size = 2, @TrailingComma = false] | +- EnumConstant[@AnonymousClass = false, @EffectiveVisibility = Visibility.V_PACKAGE, @Image = "HEADS", @MethodName = "new", @Name = "HEADS", @Visibility = Visibility.V_PUBLIC] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -489,7 +489,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Currency"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Currency"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -498,26 +498,26 @@ | | +- SwitchLabel[@Default = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "HEADS", @Name = "HEADS", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Heads", @Empty = false, @Image = "\"Heads\"", @Length = 5, @LiteralText = "\"Heads\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tails", @Empty = false, @Image = "\"Tails\"", @Length = 5, @LiteralText = "\"Tails\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "goodEnumSwitch2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -526,7 +526,7 @@ +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = true, @ExhaustiveEnumSwitch = true, @FallthroughSwitch = false] @@ -539,19 +539,19 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Heads", @Empty = false, @Image = "\"Heads\"", @Length = 5, @LiteralText = "\"Heads\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] +- SwitchLabel[@Default = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "TAILS", @Name = "TAILS", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Coin"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Coin"] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tails", @Empty = false, @Image = "\"Tails\"", @Length = 5, @LiteralText = "\"Tails\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt index 26347cab9b..030e156a70 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/PatternsInSwitchLabels.txt @@ -9,20 +9,20 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 3, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | +- VariableDeclarator[@Initializer = true, @Name = "o"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "123L", @IntLiteral = false, @Integral = true, @LiteralText = "123L", @LongLiteral = true, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 123.0, @ValueAsFloat = 123.0, @ValueAsInt = 123, @ValueAsLong = 123] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "formatted"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "formatted", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- SwitchExpression[@CompileTimeConstant = false, @DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -31,11 +31,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "int %d", @Empty = false, @Image = "\"int %d\"", @Length = 6, @LiteralText = "\"int %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] @@ -43,11 +43,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Long"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Long"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "l", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "long %d", @Empty = false, @Image = "\"long %d\"", @Length = 7, @LiteralText = "\"long %d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "l", @Name = "l", @ParenthesisDepth = 0, @Parenthesized = false] @@ -55,11 +55,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Double"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "double %f", @Empty = false, @Image = "\"double %f\"", @Length = 9, @LiteralText = "\"double %f\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "d", @Name = "d", @ParenthesisDepth = 0, @Parenthesized = false] @@ -67,11 +67,11 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String %s", @Empty = false, @Image = "\"String %s\"", @Length = 9, @LiteralText = "\"String %s\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] @@ -84,6 +84,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "formatted", @Name = "formatted", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt index bdd1ce8066..edd1477c37 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatterns.txt @@ -31,11 +31,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Rectangle", @CanonicalName = "RecordPatterns.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -43,11 +43,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "upperLeft", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lowerRight", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "printSum1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -56,7 +56,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -65,7 +65,7 @@ | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -88,7 +88,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -99,7 +99,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -107,7 +107,7 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -122,7 +122,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] @@ -133,7 +133,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -141,22 +141,22 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ul", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "c", @MethodName = "c", @ParenthesisDepth = 0, @Parenthesized = false] | +- AmbiguousName[@CompileTimeConstant = false, @Image = "ul", @Name = "ul", @ParenthesisDepth = 0, @Parenthesized = false] @@ -167,7 +167,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -175,34 +175,34 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c", @Name = "c", @ParenthesisDepth = 0, @Parenthesized = false] +- MethodDeclaration[@Abstract = false, @Arity = 6, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "createRectangle", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | +- FormalParameters[@Empty = false, @Size = 6] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -214,7 +214,7 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -226,31 +226,31 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "y2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- ArgumentList[@Empty = false, @Size = 2] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x1", @Name = "x1", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y1", @Name = "y1", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "c1", @Name = "c1", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x2", @Name = "x2", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y2", @Name = "y2", @ParenthesisDepth = 0, @Parenthesized = false] @@ -263,7 +263,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -271,36 +271,36 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- PatternList[@Empty = false, @Size = 2] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "lr", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Upper-left corner: ", @Empty = false, @Image = "\"Upper-left corner: \"", @Length = 19, @LiteralText = "\"Upper-left corner: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -310,11 +310,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "nestedPatternsCanFailToMatch", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -324,11 +324,11 @@ | +- Block[@Empty = false, @Size = 2, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] @@ -337,22 +337,22 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "p", @Name = "p", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -364,7 +364,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Not a pair of strings", @Empty = false, @Image = "\"Not a pair of strings\"", @Length = 21, @LiteralText = "\"Not a pair of strings\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Box", @CanonicalName = "RecordPatterns.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] @@ -374,7 +374,7 @@ | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test1a", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -383,9 +383,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -393,20 +393,20 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -417,9 +417,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -427,20 +427,20 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -451,9 +451,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -461,18 +461,18 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -483,11 +483,11 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- IfStatement[@Else = false] @@ -495,25 +495,25 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- PatternList[@Empty = false, @Size = 1] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -524,11 +524,11 @@ +- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- IfStatement[@Else = false] @@ -536,21 +536,21 @@ | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- RecordPattern[] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- RecordPattern[] - | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | +- PatternList[@Empty = false, @Size = 1] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "var"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "var"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 1, @containsComment = false] +- ExpressionStatement[] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt index 1d0d121f32..a73561159f 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RecordPatternsExhaustiveSwitch.txt @@ -8,23 +8,23 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$B", @CanonicalName = "RecordPatternsExhaustiveSwitch.B", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "B", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$I", @CanonicalName = "RecordPatternsExhaustiveSwitch.I", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = true, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = false, @RegularInterface = true, @SimpleName = "I", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT, JModifier.STATIC), @ExplicitModifiers = (JModifier.SEALED)] | +- PermitsList[@Empty = false, @Size = 2] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "D"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$C", @CanonicalName = "RecordPatternsExhaustiveSwitch.C", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "C", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$D", @CanonicalName = "RecordPatternsExhaustiveSwitch.D", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "D", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatternsExhaustiveSwitch$Pair", @CanonicalName = "RecordPatternsExhaustiveSwitch.Pair", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Pair", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] @@ -33,11 +33,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "x", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "y", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -47,17 +47,17 @@ +- Block[@Empty = false, @Size = 5, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | +- VariableDeclarator[@Initializer = true, @Name = "p1"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | +- VariableDeclarator[@Initializer = true, @Name = "p2"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] @@ -66,64 +66,64 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "B"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "B"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "A"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "A"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "a2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "exhaustive now", @Empty = false, @Image = "\"exhaustive now\"", @Length = 14, @LiteralText = "\"exhaustive now\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -131,43 +131,43 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -175,63 +175,63 @@ +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | | +- PatternList[@Empty = false, @Size = 2] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "D"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "C"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "C"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- SwitchArrowBranch[@Default = false] +- SwitchLabel[@Default = false] | +- RecordPattern[] - | +- ClassType[@FullyQualified = false, @SimpleName = "Pair"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Pair"] | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "I"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "I"] | +- PatternList[@Empty = false, @Size = 2] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "D"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "D"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d1", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "D"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "D"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "d2", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt index 058cbaefed..9c6da138a2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/RefiningPatternsInSwitch.txt @@ -8,12 +8,12 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Rectangle", @CanonicalName = "RefiningPatternsInSwitch.Rectangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Rectangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RefiningPatternsInSwitch$Triangle", @CanonicalName = "RefiningPatternsInSwitch.Triangle", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Triangle", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] | +- ClassBody[@Empty = false, @Size = 3] | +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PRIVATE, @Static = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE), @ExplicitModifiers = (JModifier.PRIVATE)] @@ -46,7 +46,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -59,7 +59,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -72,7 +72,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- BreakStatement[@Label = null] @@ -82,7 +82,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -91,7 +91,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -105,7 +105,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -116,7 +116,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -124,7 +124,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "A shape, possibly a small triangle", @Empty = false, @Image = "\"A shape, possibly a small triangle\"", @Length = 34, @LiteralText = "\"A shape, possibly a small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "testTriangleRefined2", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -133,7 +133,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Shape"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Shape"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -147,7 +147,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.GT, @ParenthesisDepth = 0, @Parenthesized = false] @@ -158,19 +158,19 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Large triangle", @Empty = false, @Image = "\"Large triangle\"", @Length = 14, @LiteralText = "\"Large triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "t", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Small triangle", @Empty = false, @Image = "\"Small triangle\"", @Length = 14, @LiteralText = "\"Small triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = true] @@ -178,7 +178,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Non-triangle", @Empty = false, @Image = "\"Non-triangle\"", @Length = 12, @LiteralText = "\"Non-triangle\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -188,36 +188,36 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- Block[@Empty = false, @Size = 12, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "large"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "large", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "200", @IntLiteral = true, @Integral = true, @LiteralText = "200", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 200.0, @ValueAsFloat = 200.0, @ValueAsInt = 200, @ValueAsLong = 200] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | +- VariableDeclarator[@Initializer = true, @Name = "small"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "small", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Triangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Triangle"] | +- ArgumentList[@Empty = false, @Size = 1] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "10", @IntLiteral = true, @Integral = true, @LiteralText = "10", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 10.0, @ValueAsFloat = 10.0, @ValueAsInt = 10, @ValueAsLong = 10] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | +- VariableDeclarator[@Initializer = true, @Name = "rect"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "rect", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | +- ArgumentList[@Empty = true, @Size = 0] +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "testTriangle", @MethodName = "testTriangle", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt index bcce204419..9bc14e02c4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21/ScopeOfPatternVariableDeclarations.txt @@ -8,7 +8,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "obj", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -17,7 +17,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -29,7 +29,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- BreakStatement[@Label = null] @@ -42,7 +42,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] @@ -51,7 +51,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 2, @containsComment = false] | | +- IfStatement[@Else = false] @@ -65,25 +65,25 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding!", @Empty = false, @Image = "\"Ding!\"", @Length = 5, @LiteralText = "\"Ding!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Character", @Empty = false, @Image = "\"Character\"", @Length = 9, @LiteralText = "\"Character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "i", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalStateException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Invalid Integer argument of value ", @Empty = false, @Image = "\"Invalid Integer argument of value \"", @Length = 34, @LiteralText = "\"Invalid Integer argument of value \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -100,7 +100,7 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Object"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- SwitchStatement[@DefaultCase = true, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = true] @@ -109,7 +109,7 @@ | | +- SwitchLabel[@Default = false] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Character"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Character"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- IfStatement[@Else = false] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -122,7 +122,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Ding ", @Empty = false, @Image = "\"Ding \"", @Length = 5, @LiteralText = "\"Ding \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- IfStatement[@Else = false] @@ -136,14 +136,14 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "print", @MethodName = "print", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Tab ", @Empty = false, @Image = "\"Tab \"", @Length = 4, @LiteralText = "\"Tab \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "character", @Empty = false, @Image = "\"character\"", @Length = 9, @LiteralText = "\"character\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- SwitchFallthroughBranch[@Default = true] @@ -152,7 +152,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "fall-through", @Empty = false, @Image = "\"fall-through\"", @Length = 12, @LiteralText = "\"fall-through\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PUBLIC, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] @@ -162,7 +162,7 @@ | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ArrayType[@ArrayDepth = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArrayDimensions[@Empty = false, @Size = 1] | | +- ArrayTypeDim[@Varargs = false] | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "args", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -184,14 +184,14 @@ | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "e", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalStateException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalStateException"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "e", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "e", @Name = "e", @ParenthesisDepth = 0, @Parenthesized = false] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt index dff0ab9939..6063688c8c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep430_StringTemplates.txt @@ -12,15 +12,15 @@ | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -30,19 +30,19 @@ | +- Block[@Empty = false, @Size = 19, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -55,7 +55,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -77,7 +77,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -94,7 +94,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -106,18 +106,18 @@ | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "2022-03-25", @Empty = false, @Image = "\"2022-03-25\"", @Length = 10, @LiteralText = "\"2022-03-25\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -135,22 +135,22 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -169,7 +169,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -187,7 +187,7 @@ | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -197,13 +197,13 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DateTimeFormatter"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "DateTimeFormatter"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "HH:mm:ss", @Empty = false, @Image = "\"HH:mm:ss\"", @Length = 8, @LiteralText = "\"HH:mm:ss\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "now", @MethodName = "now", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "LocalTime"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -214,7 +214,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -236,7 +236,7 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] @@ -247,7 +247,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -273,7 +273,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -299,7 +299,7 @@ | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -311,19 +311,19 @@ | +- Block[@Empty = false, @Size = 10, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -336,25 +336,25 @@ | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -373,7 +373,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -396,38 +396,38 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -526,7 +526,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -550,38 +550,38 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] @@ -681,13 +681,13 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] @@ -698,7 +698,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] @@ -710,7 +710,7 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -724,7 +724,7 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -733,17 +733,17 @@ | | +- TemplateFragment[@Content = "\"Welcome to your account\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "User"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -765,7 +765,7 @@ +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index 482d1fe703..0f4ecad416 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -35,11 +35,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -49,41 +49,41 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -99,10 +99,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -118,7 +118,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -128,34 +128,34 @@ +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.SEALED, JModifier.ABSTRACT)] | +- PermitsList[@Empty = false, @Size = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep443_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep443_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -165,29 +165,29 @@ | +- Block[@Empty = false, @Size = 5, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | | +- VariableDeclarator[@Initializer = true, @Name = "b"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -195,11 +195,11 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -207,11 +207,11 @@ | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -220,18 +220,18 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -239,18 +239,18 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- UnnamedPattern[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -266,18 +266,18 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -289,7 +289,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- UnnamedPattern[] | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -300,10 +300,10 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] @@ -338,9 +338,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Order"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -352,7 +352,7 @@ | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] @@ -369,7 +369,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "total: ", @Empty = false, @Image = "\"total: \"", @Length = 7, @LiteralText = "\"total: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -398,18 +398,18 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Queue"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- VariableDeclarator[@Initializer = true, @Name = "q"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ArrayDeque"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- WhileStatement[] @@ -445,11 +445,11 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] @@ -483,34 +483,34 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep443_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep443_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "AutoCloseable"] | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Override"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Override"] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -526,12 +526,12 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -544,27 +544,27 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NumberFormatException"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bad number: ", @Empty = false, @Image = "\"Bad number: \"", @Length = 12, @LiteralText = "\"Bad number: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -572,14 +572,14 @@ | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Exception"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "error...", @Empty = false, @Image = "\"error...\"", @Length = 8, @LiteralText = "\"error...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ExpressionStatement[] @@ -587,7 +587,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -595,11 +595,11 @@ +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Collectors"] +- ArgumentList[@Empty = false, @Size = 2] +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt index 4826a0bcb2..a97300e816 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses1.txt @@ -8,6 +8,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello World", @Empty = false, @Image = "\"Hello World\"", @Length = 11, @LiteralText = "\"Hello World\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt index 95f5757567..19e21b97b2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses2.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -15,7 +15,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt index 66f34f82b4..0e87186061 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep445_UnnamedClasses3.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -14,6 +14,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt index 9a4174133e..79980d1cc8 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -35,11 +35,11 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "c", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns1", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -49,41 +49,41 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "4", @IntLiteral = true, @Integral = true, @LiteralText = "4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 4.0, @ValueAsFloat = 4.0, @ValueAsInt = 4, @ValueAsLong = 4] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "GREEN", @Name = "GREEN", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | +- IfStatement[@Else = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "p", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Color"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Color"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -99,10 +99,10 @@ | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "r", @Name = "r", @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ColoredPoint"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ColoredPoint"] | | +- PatternList[@Empty = false, @Size = 2] | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | | +- PatternList[@Empty = false, @Size = 2] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -118,7 +118,7 @@ | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -128,34 +128,34 @@ +- ClassDeclaration[@Abstract = true, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Ball", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Ball", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Ball", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.SEALED, JModifier.ABSTRACT), @ExplicitModifiers = (JModifier.SEALED, JModifier.ABSTRACT)] | +- PermitsList[@Empty = false, @Size = 3] - | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] - | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$RedBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.RedBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RedBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$BlueBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.BlueBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "BlueBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$GreenBall", @CanonicalName = "Jep456_UnamedPatternsAndVariables.GreenBall", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "GreenBall", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- ClassBody[@Empty = true, @Size = 0] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$Box", @CanonicalName = "Jep456_UnamedPatternsAndVariables.Box", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Box", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- TypeParameters[@Empty = false, @Size = 1] | | +- TypeParameter[@Image = "T", @Name = "T", @TypeBound = true] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | +- RecordComponentList[@Empty = false, @Size = 1, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "T"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "T"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "content", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unnamedPatterns2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -165,29 +165,29 @@ | +- Block[@Empty = false, @Size = 5, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | | +- VariableDeclarator[@Initializer = true, @Name = "b"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- SwitchStatement[@DefaultCase = false, @EnumSwitch = false, @ExhaustiveEnumSwitch = false, @FallthroughSwitch = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "b", @Name = "b", @ParenthesisDepth = 0, @Parenthesized = false] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -195,11 +195,11 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -207,11 +207,11 @@ | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArgumentList[@Empty = true, @Size = 0] @@ -220,18 +220,18 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | | +- PatternList[@Empty = false, @Size = 1] | | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "processBox", @MethodName = "processBox", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] @@ -239,18 +239,18 @@ | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "GreenBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "GreenBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "stopProcessing", @MethodName = "stopProcessing", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- PatternList[@Empty = false, @Size = 1] | | | +- UnnamedPattern[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -266,18 +266,18 @@ | +- SwitchArrowBranch[@Default = false] | | +- SwitchLabel[@Default = false] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RedBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RedBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- RecordPattern[] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | | +- PatternList[@Empty = false, @Size = 1] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "BlueBall"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BlueBall"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- Guard[] | | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.EQ, @ParenthesisDepth = 0, @Parenthesized = false] @@ -289,7 +289,7 @@ | +- SwitchArrowBranch[@Default = false] | +- SwitchLabel[@Default = false] | | +- RecordPattern[] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- PatternList[@Empty = false, @Size = 1] | | +- UnnamedPattern[] | +- MethodCall[@CompileTimeConstant = false, @Image = "pickAnotherBox", @MethodName = "pickAnotherBox", @ParenthesisDepth = 0, @Parenthesized = false] @@ -300,10 +300,10 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Box"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- WildcardType[@LowerBound = false, @UpperBound = true] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Ball"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Ball"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "b", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PRIVATE, @Final = false, @Name = "stopProcessing", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PRIVATE, @Void = true] @@ -338,9 +338,9 @@ | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Order"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "orders", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 7, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -352,7 +352,7 @@ | +- ForeachStatement[] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Order"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Order"] | | | +- VariableDeclarator[@Initializer = false, @Name = "_"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = true, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "orders", @Name = "orders", @ParenthesisDepth = 0, @Parenthesized = false] @@ -369,7 +369,7 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "total: ", @Empty = false, @Image = "\"total: \"", @Length = 7, @LiteralText = "\"total: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -398,18 +398,18 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Queue"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Queue"] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | +- VariableDeclarator[@Initializer = true, @Name = "q"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "q", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = true, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "ArrayDeque"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ArrayDeque"] | | | +- TypeArguments[@Diamond = true, @Empty = true, @Size = 0] | | +- ArgumentList[@Empty = true, @Size = 0] | +- WhileStatement[] @@ -445,11 +445,11 @@ | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- VariableDeclarator[@Initializer = true, @Name = "p"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "y", @Name = "y", @ParenthesisDepth = 0, @Parenthesized = false] @@ -483,34 +483,34 @@ | | +- ArgumentList[@Empty = true, @Size = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- VariableDeclarator[@Initializer = true, @Name = "p"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "p", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Point"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Point"] | +- ArgumentList[@Empty = false, @Size = 2] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "x", @Name = "x", @ParenthesisDepth = 0, @Parenthesized = false] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep456_UnamedPatternsAndVariables$ScopedContext", @CanonicalName = "Jep456_UnamedPatternsAndVariables.ScopedContext", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "ScopedContext", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] | +- ImplementsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "AutoCloseable"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "AutoCloseable"] | +- ClassBody[@Empty = false, @Size = 2] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "close", @Overridden = true, @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = true] | | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | | | +- Annotation[@SimpleName = "Override"] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Override"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Override"] | | +- VoidType[] | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = true, @Size = 0, @containsComment = false] | +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "acquire", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | +- ArgumentList[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "unusedVariables2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -526,12 +526,12 @@ | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = true, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "acquire", @MethodName = "acquire", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "ScopedContext"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "ScopedContext"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = true] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "123", @Empty = false, @Image = "\"123\"", @Length = 3, @LiteralText = "\"123\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -544,27 +544,27 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "i", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "parseInt", @MethodName = "parseInt", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Integer"] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "i", @Name = "i", @ParenthesisDepth = 0, @Parenthesized = false] | +- CatchClause[] | | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "NumberFormatException"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "NumberFormatException"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bad number: ", @Empty = false, @Image = "\"Bad number: \"", @Length = 12, @LiteralText = "\"Bad number: \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -572,14 +572,14 @@ | +- CatchClause[] | +- CatchParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Multicatch = false, @Name = "_", @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Exception"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Exception"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = true, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "error...", @Empty = false, @Image = "\"error...\"", @Length = 8, @LiteralText = "\"error...\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- ExpressionStatement[] @@ -587,7 +587,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "of", @MethodName = "of", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "List"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "List"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "a", @Empty = false, @Image = "\"a\"", @Length = 1, @LiteralText = "\"a\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "b", @Empty = false, @Image = "\"b\"", @Length = 1, @LiteralText = "\"b\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -595,11 +595,11 @@ +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "toMap", @MethodName = "toMap", @ParenthesisDepth = 0, @Parenthesized = false] +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Collectors"] +- ArgumentList[@Empty = false, @Size = 2] +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt index acd50b8006..718c3f900d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep447_StatementsBeforeSuper.txt @@ -19,7 +19,7 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$PositiveBigInteger", @CanonicalName = "Jep447_StatementsBeforeSuper.PositiveBigInteger", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "PositiveBigInteger", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC, JModifier.STATIC), @ExplicitModifiers = (JModifier.PUBLIC, JModifier.STATIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "BigInteger"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "BigInteger"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "PositiveBigInteger", @Name = "PositiveBigInteger", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -35,17 +35,17 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "non-positive value", @Empty = false, @Image = "\"non-positive value\"", @Length = 18, @LiteralText = "\"non-positive value\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (JModifier.FINAL), @ExplicitModifiers = (JModifier.FINAL)] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "valueAsString"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "valueAsString", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- MethodCall[@CompileTimeConstant = false, @Image = "valueOf", @MethodName = "valueOf", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "value", @Name = "value", @ParenthesisDepth = 0, @Parenthesized = false] | +- ExplicitConstructorInvocation[@ArgumentCount = 1, @MethodName = "new", @Qualified = false, @Super = true, @This = false] @@ -68,14 +68,14 @@ +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Super"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Super"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Sub", @Name = "Sub", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = false] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- FormalParameters[@Empty = false, @Size = 1] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Certificate"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Certificate"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "certificate", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = false, @Size = 4, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] @@ -91,7 +91,7 @@ | | | +- NullLiteral[@CompileTimeConstant = false, @LiteralText = "null", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "null certificate", @Empty = false, @Image = "\"null certificate\"", @Length = 16, @LiteralText = "\"null certificate\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = true, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -108,7 +108,7 @@ | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "RSAKey"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "RSAKey"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "rsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] @@ -117,12 +117,12 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"] | | +- SwitchArrowBranch[@Default = false] | | | +- SwitchLabel[@Default = false] | | | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DSAPublicKey"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "DSAPublicKey"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "dsaKey", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getBytes", @MethodName = "getBytes", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "toString", @MethodName = "toString", @ParenthesisDepth = 0, @Parenthesized = false] @@ -131,7 +131,7 @@ | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "UTF_8", @Name = "UTF_8", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "StandardCharsets"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StandardCharsets"] | | +- SwitchArrowBranch[@Default = true] | | +- SwitchLabel[@Default = true] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -154,17 +154,17 @@ | +- FormalParameters[@Empty = false, @Size = 2] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "f2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Jep447_StatementsBeforeSuper$Sub2", @CanonicalName = "Jep447_StatementsBeforeSuper.Sub2", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "Sub2", @Static = false, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] | +- ExtendsList[@Empty = false, @Size = 1] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Super2"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Super2"] | +- ClassBody[@Empty = false, @Size = 1] | +- ConstructorDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Image = "Sub2", @Name = "Sub2", @Static = false, @Varargs = false, @Visibility = Visibility.V_PUBLIC, @containsComment = true] | +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] @@ -179,7 +179,7 @@ | | +- VariableDeclarator[@Initializer = true, @Name = "f"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "f", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "F"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "F"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExplicitConstructorInvocation[@ArgumentCount = 2, @MethodName = "new", @Qualified = false, @Super = true, @This = false] | +- ArgumentList[@Empty = false, @Size = 2] @@ -219,11 +219,11 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "hi", @Name = "hi", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d)", @Empty = false, @Image = "\"(%d,%d)\"", @Length = 7, @LiteralText = "\"(%d,%d)\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] @@ -236,11 +236,11 @@ | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "maxDistance", @Name = "maxDistance", @ParenthesisDepth = 0, @Parenthesized = false] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- ArgumentList[@Empty = false, @Size = 4] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "(%d,%d,%d", @Empty = false, @Image = "\"(%d,%d,%d\"", @Length = 9, @LiteralText = "\"(%d,%d,%d\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "lo", @Name = "lo", @ParenthesisDepth = 0, @Parenthesized = false] @@ -276,7 +276,7 @@ | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | | +- ThrowStatement[] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "IllegalArgumentException"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "IllegalArgumentException"] | | +- ArgumentList[@Empty = true, @Size = 0] | +- ExplicitConstructorInvocation[@ArgumentCount = 0, @MethodName = "new", @Qualified = false, @Super = false, @This = true] | +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt index 969a8c9b36..606a7199e4 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep459_StringTemplates.txt @@ -12,15 +12,15 @@ | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "date", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "time", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "ipAddress", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | +- RecordBody[@Empty = true, @Size = 0] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "STRTemplateProcessor", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -30,19 +30,19 @@ | +- Block[@Empty = false, @Size = 19, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "firstName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "firstName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bill", @Empty = false, @Image = "\"Bill\"", @Length = 4, @LiteralText = "\"Bill\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "lastName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lastName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Duck", @Empty = false, @Image = "\"Duck\"", @Length = 4, @LiteralText = "\"Duck\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "fullName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "fullName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -55,7 +55,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "sortName"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sortName", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -77,7 +77,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "20", @IntLiteral = true, @Integral = true, @LiteralText = "20", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 20.0, @ValueAsFloat = 20.0, @ValueAsInt = 20, @ValueAsLong = 20] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -94,7 +94,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -106,18 +106,18 @@ | | +- TemplateFragment[@Content = "} waiting for you!\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | +- VariableDeclarator[@Initializer = true, @Name = "req"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "req", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Request"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Request"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "2022-03-25", @Empty = false, @Image = "\"2022-03-25\"", @Length = 10, @LiteralText = "\"2022-03-25\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "15:34", @Empty = false, @Image = "\"15:34\"", @Length = 5, @LiteralText = "\"15:34\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "8.8.8.8", @Empty = false, @Image = "\"8.8.8.8\"", @Length = 7, @LiteralText = "\"8.8.8.8\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "t"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "t", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -135,22 +135,22 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "filePath"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "filePath", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "tmp.dat", @Empty = false, @Image = "\"tmp.dat\"", @Length = 7, @LiteralText = "\"tmp.dat\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | +- VariableDeclarator[@Initializer = true, @Name = "file"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "file", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "File"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "File"] | | +- ArgumentList[@Empty = false, @Size = 1] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "filePath", @Name = "filePath", @ParenthesisDepth = 0, @Parenthesized = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "old"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "old", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] @@ -169,7 +169,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = " exist", @Empty = false, @Image = "\" exist\"", @Length = 6, @LiteralText = "\" exist\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "msg"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "msg", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -187,7 +187,7 @@ | | +- TemplateFragment[@Content = "} exist\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "time"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "time", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -197,13 +197,13 @@ | | +- MethodCall[@CompileTimeConstant = false, @Image = "format", @MethodName = "format", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "ofPattern", @MethodName = "ofPattern", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | | +- ClassType[@FullyQualified = false, @SimpleName = "DateTimeFormatter"] + | | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "DateTimeFormatter"] | | | | +- ArgumentList[@Empty = false, @Size = 1] | | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "HH:mm:ss", @Empty = false, @Image = "\"HH:mm:ss\"", @Length = 8, @LiteralText = "\"HH:mm:ss\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- ArgumentList[@Empty = false, @Size = 1] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "now", @MethodName = "now", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "LocalTime"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "LocalTime"] | | | +- ArgumentList[@Empty = true, @Size = 0] | | +- TemplateFragment[@Content = "} right now\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -214,7 +214,7 @@ | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "0", @IntLiteral = true, @Integral = true, @LiteralText = "0", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 0.0, @ValueAsFloat = 0.0, @ValueAsInt = 0, @ValueAsLong = 0] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "data"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "data", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -236,7 +236,7 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "fruit"] @@ -247,7 +247,7 @@ | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "peaches", @Empty = false, @Image = "\"peaches\"", @Length = 7, @LiteralText = "\"peaches\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s3"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -273,7 +273,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s4"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -299,7 +299,7 @@ | +- TemplateFragment[@Content = "}\""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "getOfferType", @Overridden = false, @Static = true, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC), @ExplicitModifiers = (JModifier.STATIC)] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -311,19 +311,19 @@ | +- Block[@Empty = false, @Size = 10, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "title"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "title", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "My Web Page", @Empty = false, @Image = "\"My Web Page\"", @Length = 11, @LiteralText = "\"My Web Page\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "text"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "text", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, world", @Empty = false, @Image = "\"Hello, world\"", @Length = 12, @LiteralText = "\"Hello, world\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "html"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "html", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -336,25 +336,25 @@ | | +- TemplateFragment[@Content = "}

\n \n \n \"\"\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan Smith", @Empty = false, @Image = "\"Joan Smith\"", @Length = 10, @LiteralText = "\"Joan Smith\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "phone"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "phone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "555-123-4567", @Empty = false, @Image = "\"555-123-4567\"", @Length = 12, @LiteralText = "\"555-123-4567\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "address"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "address", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "1 Maple Drive, Anytown", @Empty = false, @Image = "\"1 Maple Drive, Anytown\"", @Length = 22, @LiteralText = "\"1 Maple Drive, Anytown\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "json"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "json", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -373,7 +373,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -396,38 +396,38 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -526,7 +526,7 @@ | | +- RecordComponentList[@Empty = false, @Size = 3, @Varargs = false] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "name", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | | +- RecordComponent[@EffectiveVisibility = Visibility.V_LOCAL, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -550,38 +550,38 @@ | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- VariableDeclarator[@Initializer = true, @Name = "zone"] | | +- VariableId[@ArrayType = true, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "zone", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ArrayAllocation[@ArrayDepth = 1, @CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ArrayType[@ArrayDepth = 1] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | +- ArrayTypeDim[@Varargs = false] | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Alfa", @Empty = false, @Image = "\"Alfa\"", @Length = 4, @LiteralText = "\"Alfa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "17.8", @IntLiteral = false, @Integral = false, @LiteralText = "17.8", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 17.8, @ValueAsFloat = 17.8, @ValueAsInt = 17, @ValueAsLong = 17] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "31.4", @IntLiteral = false, @Integral = false, @LiteralText = "31.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 31.4, @ValueAsFloat = 31.4, @ValueAsInt = 31, @ValueAsLong = 31] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | | +- ArgumentList[@Empty = false, @Size = 3] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Bravo", @Empty = false, @Image = "\"Bravo\"", @Length = 5, @LiteralText = "\"Bravo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "9.6", @IntLiteral = false, @Integral = false, @LiteralText = "9.6", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 9.6, @ValueAsFloat = 9.6, @ValueAsInt = 9, @ValueAsLong = 9] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "12.4", @IntLiteral = false, @Integral = false, @LiteralText = "12.4", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12.4, @ValueAsFloat = 12.4, @ValueAsInt = 12, @ValueAsLong = 12] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Rectangle"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Rectangle"] | | +- ArgumentList[@Empty = false, @Size = 3] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Charlie", @Empty = false, @Image = "\"Charlie\"", @Length = 7, @LiteralText = "\"Charlie\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "7.1", @IntLiteral = false, @Integral = false, @LiteralText = "7.1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 7.1, @ValueAsFloat = 7.1, @ValueAsInt = 7, @ValueAsLong = 7] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = true, @FloatLiteral = false, @Image = "11.23", @IntLiteral = false, @Integral = false, @LiteralText = "11.23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 11.23, @ValueAsFloat = 11.23, @ValueAsInt = 11, @ValueAsLong = 11] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "table"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "table", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] @@ -681,13 +681,13 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "name"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "name", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Joan", @Empty = false, @Image = "\"Joan\"", @Length = 4, @LiteralText = "\"Joan\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "StringTemplate"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "StringTemplate"] | | +- VariableDeclarator[@Initializer = true, @Name = "st"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "st", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = false] @@ -698,7 +698,7 @@ | | +- TemplateFragment[@Content = "}\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "info"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "info", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- MethodCall[@CompileTimeConstant = false, @Image = "process", @MethodName = "process", @ParenthesisDepth = 0, @Parenthesized = false] @@ -710,7 +710,7 @@ | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] - | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PRIVATE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = true, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "firstName", @PatternBinding = false, @RecordComponent = true, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PRIVATE] | | +- RecordComponent[@EffectiveVisibility = Visibility.V_PRIVATE, @Varargs = false, @Visibility = Visibility.V_PRIVATE] | | +- ModifierList[@EffectiveModifiers = (JModifier.PRIVATE, JModifier.FINAL), @ExplicitModifiers = ()] @@ -724,7 +724,7 @@ | +- Block[@Empty = false, @Size = 3, @containsComment = true] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | +- VariableDeclarator[@Initializer = true, @Name = "s1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -733,17 +733,17 @@ | | +- TemplateFragment[@Content = "\"Welcome to your account\""] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "User"] | | +- VariableDeclarator[@Initializer = true, @Name = "user"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | +- ConstructorCall[@AnonymousClass = false, @CompileTimeConstant = false, @DiamondTypeArgs = false, @MethodName = "new", @ParenthesisDepth = 0, @Parenthesized = false, @QualifiedInstanceCreation = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "User"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "User"] | | +- ArgumentList[@Empty = false, @Size = 2] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Lisa", @Empty = false, @Image = "\"Lisa\"", @Length = 4, @LiteralText = "\"Lisa\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "12345", @IntLiteral = true, @Integral = true, @LiteralText = "12345", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 12345.0, @ValueAsFloat = 12345.0, @ValueAsInt = 12345, @ValueAsLong = 12345] | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "s2"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] @@ -765,7 +765,7 @@ +- Block[@Empty = false, @Size = 1, @containsComment = false] +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - +- ClassType[@FullyQualified = false, @SimpleName = "String"] + +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] +- VariableDeclarator[@Initializer = true, @Name = "s1"] +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "s1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] +- TemplateExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false, @StringTemplate = true] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt index 4826a0bcb2..a97300e816 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses1.txt @@ -8,6 +8,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello World", @Empty = false, @Image = "\"Hello World\"", @Length = 11, @LiteralText = "\"Hello World\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt index 95f5757567..19e21b97b2 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses2.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "greeting", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = false] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- FormalParameters[@Empty = true, @Size = 0] | +- Block[@Empty = false, @Size = 1, @containsComment = false] | +- ReturnStatement[] @@ -15,7 +15,7 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- MethodCall[@CompileTimeConstant = false, @Image = "greeting", @MethodName = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] +- ArgumentList[@Empty = true, @Size = 0] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt index 66f34f82b4..0e87186061 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses3.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello, World!", @Empty = false, @Image = "\"Hello, World!\"", @Length = 13, @LiteralText = "\"Hello, World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -14,6 +14,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt index 5b20d948df..c13f0668fc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22p/Jep463_UnnamedClasses4WithImports.txt @@ -3,14 +3,14 @@ +- ImportDeclaration[@ImportOnDemand = false, @ImportedName = "java.util.stream.Collectors", @ImportedSimpleName = "Collectors", @PackageName = "java.util.stream", @Static = false] +- FieldDeclaration[@EffectiveVisibility = Visibility.V_PACKAGE, @Static = false, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] - | +- ClassType[@FullyQualified = false, @SimpleName = "String"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | +- VariableDeclarator[@Initializer = true, @Name = "greeting"] | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "greeting", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | +- MethodCall[@CompileTimeConstant = false, @Image = "collect", @MethodName = "collect", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "stream", @MethodName = "stream", @ParenthesisDepth = 0, @Parenthesized = false] | | +- MethodCall[@CompileTimeConstant = false, @Image = "asList", @MethodName = "asList", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Arrays"] + | | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Arrays"] | | | +- ArgumentList[@Empty = false, @Size = 2] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Hello", @Empty = false, @Image = "\"Hello\"", @Length = 5, @LiteralText = "\"Hello\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "World!", @Empty = false, @Image = "\"World!\"", @Length = 6, @LiteralText = "\"World!\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] @@ -18,7 +18,7 @@ | +- ArgumentList[@Empty = false, @Size = 1] | +- MethodCall[@CompileTimeConstant = false, @Image = "joining", @MethodName = "joining", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | | +- ClassType[@FullyQualified = false, @SimpleName = "Collectors"] + | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Collectors"] | +- ArgumentList[@Empty = false, @Size = 1] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = ", ", @Empty = false, @Image = "\", \"", @Length = 2, @LiteralText = "\", \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @MainMethod = true, @Name = "main", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] @@ -30,6 +30,6 @@ +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] - | +- ClassType[@FullyQualified = false, @SimpleName = "System"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] +- ArgumentList[@Empty = false, @Size = 1] +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "greeting", @Name = "greeting", @ParenthesisDepth = 0, @Parenthesized = false] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info.txt index ba4b32715b..f66cf45b11 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info.txt @@ -11,11 +11,11 @@ +- ModuleExportsDirective[@PackageName = "com.example.foo.internal"] | +- ModuleName[@Name = "com.example.foo.probe"] +- ModuleUsesDirective[] - | +- ClassType[@FullyQualified = true, @SimpleName = "Intf"] + | +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo.spi", @SimpleName = "Intf"] +- ModuleProvidesDirective[] - | +- ClassType[@FullyQualified = true, @SimpleName = "Intf"] - | +- ClassType[@FullyQualified = true, @SimpleName = "Impl"] + | +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo.spi", @SimpleName = "Intf"] + | +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo", @SimpleName = "Impl"] +- ModuleProvidesDirective[] - +- ClassType[@FullyQualified = true, @SimpleName = "Intf2"] - +- ClassType[@FullyQualified = true, @SimpleName = "Impl"] - +- ClassType[@FullyQualified = true, @SimpleName = "Impl2"] + +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo.spi", @SimpleName = "Intf2"] + +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo", @SimpleName = "Impl"] + +- ClassType[@FullyQualified = true, @PackageQualifier = "com.example.foo", @SimpleName = "Impl2"] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info_with_annot.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info_with_annot.txt index 2f4b68b7bf..a911c31526 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info_with_annot.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java9/jdk9_module_info_with_annot.txt @@ -1,7 +1,7 @@ +- CompilationUnit[@PackageName = ""] +- ModuleDeclaration[@Name = "jdk.pack", @Open = false] +- Annotation[@SimpleName = "Deprecated"] - | +- ClassType[@FullyQualified = false, @SimpleName = "Deprecated"] + | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Deprecated"] | +- AnnotationMemberList[@Empty = false, @Size = 2] | +- MemberValuePair[@Image = "since", @Name = "since", @Shorthand = false] | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "11", @Empty = false, @Image = "\"11\"", @Length = 2, @LiteralText = "\"11\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] From ff6f528647dead649a3c1ea9ff395f8147f207e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 16:13:19 +0200 Subject: [PATCH 054/121] Add tests --- .../java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java | 2 +- .../kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt | 2 ++ .../sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java index 05ddfc78b3..fc06aee527 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java @@ -135,7 +135,7 @@ public final class ASTClassType extends AbstractJavaTypeNode implements ASTRefer */ public @Nullable String getPackageQualifier() { if (isFullyQualified()) { - assert symbol != null: "Symbol should be non-null if isFullyQualified returns true"; + assert symbol != null : "Symbol should be non-null if isFullyQualified returns true"; return symbol.getPackageName(); } return null; diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt index 71092f20cf..7805804ed9 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt @@ -22,6 +22,7 @@ class ASTTypeTest : ParserTestSpec({ it::getTypeArguments shouldBe null it::getQualifier shouldBe null + it::getPackageQualifier shouldBe null it::getAmbiguousLhs shouldBe child { it::getName shouldBe "java.util" @@ -33,6 +34,7 @@ class ASTTypeTest : ParserTestSpec({ classType("List") { it::getQualifier shouldBe null + it::getPackageQualifier shouldBe null it::getAmbiguousLhs shouldBe child { it::getName shouldBe "java.util" diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index fa37adf86c..32ed3b5165 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt @@ -39,6 +39,7 @@ class TypeDisambiguationTest : ParserTestSpec({ it::getAmbiguousLhs shouldBe null it::getQualifier shouldBe classType("Foo") { it::isFullyQualified shouldBe false + it::getPackageQualifier shouldBe null it::getReferencedSym shouldBe foo } } @@ -52,6 +53,7 @@ class TypeDisambiguationTest : ParserTestSpec({ "javasymbols.testdata.Statics" should parseAs { qualClassType("javasymbols.testdata.Statics") { it::isFullyQualified shouldBe true + it::getPackageQualifier shouldBe "javasymbols.testdata" it::getQualifier shouldBe null it::getAmbiguousLhs shouldBe null } @@ -63,6 +65,7 @@ class TypeDisambiguationTest : ParserTestSpec({ it::getQualifier shouldBe qualClassType("javasymbols.testdata.Statics") { it::isFullyQualified shouldBe true + it::getPackageQualifier shouldBe "javasymbols.testdata" it::getQualifier shouldBe null it::getAmbiguousLhs shouldBe null } From 7f0d148a1ba64fa8e66654a838527c1a78293ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sat, 11 May 2024 20:41:36 +0200 Subject: [PATCH 055/121] Fix FPs --- .../net/sourceforge/pmd/util/DataMap.java | 10 ++++ .../pmd/lang/java/ast/ASTAssignableExpr.java | 3 ++ .../java/rule/design/SingularFieldRule.java | 3 ++ .../lang/java/rule/internal/DataflowPass.java | 50 +++++++++++-------- .../xml/LocalVariableCouldBeFinal.xml | 43 ++++++++++++++-- 5 files changed, 83 insertions(+), 26 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/util/DataMap.java b/pmd-core/src/main/java/net/sourceforge/pmd/util/DataMap.java index 796bdba7bf..8629416288 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/util/DataMap.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/util/DataMap.java @@ -6,9 +6,11 @@ package net.sourceforge.pmd.util; import java.util.IdentityHashMap; import java.util.Map; +import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -88,6 +90,14 @@ public final class DataMap { return (T) getMap().compute(key, (k, v) -> function.apply((T) v)); } + /** + * @see Map#merge(Object, Object, BiFunction) + */ + @SuppressWarnings({ "unchecked", "rawtypes" }) + public T merge(DataKey key, T value, BiFunction function) { + return (T) getMap().merge(key, value, (BiFunction) function); + } + private Map, Object> getMap() { // the map is lazily created, it's only needed if set() is called // at least once, but get() might be called many more times, as diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignableExpr.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignableExpr.java index 72ea5e9282..d504ee9244 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignableExpr.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAssignableExpr.java @@ -36,6 +36,9 @@ public interface ASTAssignableExpr extends ASTPrimaryExpression { * If this expression occurs as the left-hand-side of an {@linkplain ASTAssignmentExpression assignment}, * or as the target of an {@linkplain ASTUnaryExpression increment or decrement expression}, * this method returns {@link AccessType#WRITE}. Otherwise the value is just {@linkplain AccessType#READ read}. + * + * @see JavaAstUtils#isVarAccessReadAndWrite(ASTNamedReferenceExpr) + * @see JavaAstUtils#isVarAccessStrictlyWrite(ASTNamedReferenceExpr) */ default @NonNull AccessType getAccessType() { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldRule.java index 48fea5699a..a9ef81f209 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/SingularFieldRule.java @@ -165,6 +165,9 @@ public class SingularFieldRule extends AbstractJavaRulechainRule { private boolean usagesObserveValueBeforeMethodCall(List usages, DataflowResult dataflow) { for (ASTNamedReferenceExpr usage : usages) { + if (JavaAstUtils.isVarAccessStrictlyWrite(usage)) { + continue; + } ReachingDefinitionSet reaching = dataflow.getReachingDefinitions(usage); if (reaching.containsInitialFieldValue()) { return true; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java index fe0b890f35..d188c63e43 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/internal/DataflowPass.java @@ -236,11 +236,11 @@ public final class DataflowPass { } public static ReachingDefinitionSet unknown() { - return UNKNOWN; + return new ReachingDefinitionSet(); } public static ReachingDefinitionSet blank() { - return EMPTY_KNOWN; + return new ReachingDefinitionSet(emptySet()); } } @@ -990,23 +990,25 @@ public final class DataflowPass { } - private SpanInfo processAssignment(ASTExpression lhs, // LHS or unary operand + private SpanInfo processAssignment(ASTExpression lhs0, // LHS or unary operand ASTExpression rhs, // RHS or unary boolean useBeforeAssigning, SpanInfo result) { - if (lhs instanceof ASTNamedReferenceExpr) { - JVariableSymbol lhsVar = ((ASTNamedReferenceExpr) lhs).getReferencedSym(); + if (lhs0 instanceof ASTNamedReferenceExpr) { + ASTNamedReferenceExpr lhs = (ASTNamedReferenceExpr) lhs0; + JVariableSymbol lhsVar = lhs.getReferencedSym(); if (lhsVar != null && (lhsVar instanceof JLocalVariableSymbol || isRelevantField(lhs))) { if (useBeforeAssigning) { // compound assignment, to use BEFORE assigning - result.use(lhsVar, (ASTNamedReferenceExpr) lhs); + result.use(lhsVar, lhs); } - result.assign(lhsVar, rhs); + VarLocalInfo oldVar = result.assign(lhsVar, rhs); + SpanInfo.updateReachingDefs(lhs, lhsVar, oldVar); } } return result; @@ -1346,11 +1348,12 @@ public final class DataflowPass { assign(id.getSymbol(), id); } - void assign(JVariableSymbol var, JavaNode rhs) { - assign(var, rhs, SpecialAssignmentKind.NOT_SPECIAL); + VarLocalInfo assign(JVariableSymbol var, JavaNode rhs) { + return assign(var, rhs, SpecialAssignmentKind.NOT_SPECIAL); } - @Nullable AssignmentEntry assign(JVariableSymbol var, JavaNode rhs, SpecialAssignmentKind kind) { + @Nullable + VarLocalInfo assign(JVariableSymbol var, JavaNode rhs, SpecialAssignmentKind kind) { ASTVariableId node = var.tryGetNode(); if (node == null) { return null; // we don't care about non-local declarations @@ -1380,7 +1383,7 @@ public final class DataflowPass { } } global.allAssignments.add(entry); - return entry; + return previous; } void declareSpecialFieldValues(JClassSymbol sym, boolean onlyStatic) { @@ -1424,20 +1427,25 @@ public final class DataflowPass { if (info != null) { global.usedAssignments.addAll(info.reachingDefs); if (reachingDefSink != null) { - ReachingDefinitionSet reaching = new ReachingDefinitionSet(new LinkedHashSet<>(info.reachingDefs)); - // need to merge into previous to account for cyclic control flow - reachingDefSink.getUserMap().compute(REACHING_DEFS, current -> { - if (current != null) { - current.absorb(reaching); - return current; - } else { - return reaching; - } - }); + updateReachingDefs(reachingDefSink, var, info); } } } + private static void updateReachingDefs(@NonNull ASTNamedReferenceExpr reachingDefSink, JVariableSymbol var, VarLocalInfo info) { + ReachingDefinitionSet reaching; + if (info == null || var.isField() && var.isFinal()) { + return; + } else { + reaching = new ReachingDefinitionSet(new LinkedHashSet<>(info.reachingDefs)); + } + // need to merge into previous to account for cyclic control flow + reachingDefSink.getUserMap().merge(REACHING_DEFS, reaching, (current, newer) -> { + current.absorb(newer); + return current; + }); + } + void deleteVar(JVariableSymbol var) { symtable.remove(var); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml index 209d2cbd55..54b7d3201a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/LocalVariableCouldBeFinal.xml @@ -325,15 +325,20 @@ public class ClassWithLambda { #3122 should consider blank variables 2 - 7,19 + 12,24 + + + #3122 should consider blank variables + 1 + 5 + From b6c0a100956332e6c356051e311d381fd34f34c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 12 May 2024 15:30:45 +0200 Subject: [PATCH 056/121] [java] Fix #5006 - bad intersection in capture of recursive types --- .../sourceforge/pmd/lang/java/types/Lub.java | 26 ++++++++++++++++--- .../pmd/lang/java/types/CaptureTest.kt | 21 ++++++++++++++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/Lub.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/Lub.java index 80e6ac5575..9a589aa79d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/Lub.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/Lub.java @@ -340,10 +340,21 @@ final class Lub { JTypeMirror componentGlb = glb(ts, setOf(((JArrayType) ci).getComponentType(), ((JArrayType) primaryBound).getComponentType())); primaryBound = ts.arrayType(componentGlb); + } else { - throw new IllegalArgumentException( - "Bad intersection, unrelated class types " + ci + " and " + primaryBound + " in " + types - ); + // We have two primary bounds. This may happen during capture + // of recursive F-bounded types. Here we do a last resort check + // to see if one of the bounds is a subtype (unchecked) of the other. + // In that case we pick this as primary bound as it is more specific. + + int cmp = compareRelatedness(ci.getErasure(), primaryBound.getErasure()); + if (cmp == 0) { + throw new IllegalArgumentException( + "Bad intersection, unrelated class types " + ci + " and " + primaryBound + " in " + types + ); + } else if (cmp < 0) { + primaryBound = ci; + } } } else { bounds.add(ci); @@ -366,6 +377,15 @@ final class Lub { return new JIntersectionType(ts, primaryBound, bounds); } + private static int compareRelatedness(JTypeMirror t, JTypeMirror s) { + if (TypeOps.isConvertiblePure(t, s.getErasure()).withoutWarnings()) { + return -1; + } else if (TypeOps.isConvertiblePure(s, t.getErasure()).withoutWarnings()) { + return 1; + } + return 0; + } + private static void checkGlbComponent(Collection types, JTypeMirror ci) { if (ci.isPrimitive() || ci instanceof JWildcardType || ci instanceof JIntersectionType) { throw new IllegalArgumentException("Bad intersection type component: " + ci + " in " + types); diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt index 03125a0a58..a686a7436a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/CaptureTest.kt @@ -9,11 +9,12 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.symbols.internal.asm.createUnresolvedAsmSymbol import net.sourceforge.pmd.lang.java.types.TypeConversion.* +import net.sourceforge.pmd.lang.test.ast.IntelliMarker /** * @author Clรฉment Fournier */ -class CaptureTest : FunSpec({ +class CaptureTest : IntelliMarker, FunSpec({ with(TypeDslOf(testTypeSystem)) { with(gen) { @@ -69,6 +70,24 @@ class CaptureTest : FunSpec({ } } + test("Capture of recursive types #5006") { + val acu = javaParser.parse(""" + class Parent> {} // Recursive type T + + class Child extends Parent {} + + class Box> { + public void foo(Box box) {} // <-- The bug is triggered by this line + } + """.trimIndent()) + + val (_, child, box) = acu.declaredTypeSignatures() + + val type = acu.methodDeclarations().first()!!.formalParameters.get(0).typeMirror + + capture(type) shouldBe box[captureMatcher(`?` extends child)] + } + } } From 38194a49f7f867b7095c350cb01f0f67e63809aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 16:54:08 +0200 Subject: [PATCH 057/121] Fix #4042 - FN with StringBufferInstantiationWithChar --- .../src/main/resources/category/java/errorprone.xml | 7 ++++--- .../xml/StringBufferInstantiationWithChar.xml | 12 ++++++++++++ 2 files changed, 16 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 d4599e9f82..88d2b1fe2c 100644 --- a/pmd-java/src/main/resources/category/java/errorprone.xml +++ b/pmd-java/src/main/resources/category/java/errorprone.xml @@ -2642,7 +2642,7 @@ public class SomeEJB extends EJBObject implements EJBLocalHome { @@ -2668,8 +2668,9 @@ new StringBuilder("A") // 1 + 16 = 17 diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/StringBufferInstantiationWithChar.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/StringBufferInstantiationWithChar.xml index 8cb72888d4..424e90f001 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/StringBufferInstantiationWithChar.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/StringBufferInstantiationWithChar.xml @@ -29,6 +29,18 @@ public class Foo { public class Foo2 { StringBuilder sb = new StringBuilder('c'); +} + ]]> + + + failure case (not a literal) + 1 + From a80897fc71c7e42cf510ab1d20730445e8a22fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 17:18:11 +0200 Subject: [PATCH 058/121] [java] Fix #2326 - UnsynchronizedStaticFormatter FP in static initializer --- .../UnsynchronizedStaticFormatterRule.java | 19 ++++++++++++------- .../xml/ConstructorCallsOverridableMethod.xml | 19 +++++++++++++++++++ .../xml/UnsynchronizedStaticFormatter.xml | 17 +++++++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java index 152492fdb3..f6487b15f6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java @@ -8,14 +8,15 @@ import java.text.Format; import java.util.Arrays; import java.util.List; -import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTClassType; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTInitializer; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTSynchronizedStatement; +import net.sourceforge.pmd.lang.java.ast.ASTType; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.ast.JModifier; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; @@ -62,12 +63,13 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule if (!node.hasModifiers(JModifier.STATIC)) { return data; } - ASTClassType cit = node.descendants(ASTClassType.class).first(); - if (cit == null || !TypeTestUtil.isA(formatterClassToCheck, cit)) { + ASTType cit = node.getTypeNode(); + if (!(cit instanceof ASTClassType) + || !TypeTestUtil.isA(formatterClassToCheck, cit)) { return data; } - ASTVariableId var = node.descendants(ASTVariableId.class).first(); + ASTVariableId var = node.getVarIds().firstOrThrow(); for (String formatter: THREAD_SAFE_FORMATTER) { if (TypeTestUtil.isA(formatter, var)) { return data; @@ -83,8 +85,6 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule continue; } - Node n = ref; - // is there a block-level synch? ASTSynchronizedStatement syncStatement = ref.ancestors(ASTSynchronizedStatement.class).first(); if (syncStatement != null) { @@ -102,7 +102,12 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule } } - asCtx(data).addViolation(n); + boolean hasStaticInit = ref.ancestors(ASTInitializer.class).any(ASTInitializer::isStatic); + if (hasStaticInit) { + continue; + } + + asCtx(data).addViolation(ref); } return data; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml index 5581a7b041..0281087dec 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml @@ -629,6 +629,25 @@ class Foo1 { } public void bar() {} } +]]> + + + [java] ConstructorCallsOverridableMethod: false positive with lombok's @Value #4510 + 0 + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml index c9012e95eb..e6eea9edaf 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml @@ -304,4 +304,21 @@ public class Foo { } ]]> + + [java] False positive UnsynchronizedStaticFormatter in static initializer #2368 + 0 + + From 11743a49fa50dfd8b8a8753af45ce14b38f704bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 17:19:39 +0200 Subject: [PATCH 059/121] Update release notes --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..2015e6d46a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -41,6 +41,8 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources +* java-multithreading + * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer ### ๐Ÿšจ API Changes From f1701df7f250066a39056f3843de51fc4321d255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 17:22:00 +0200 Subject: [PATCH 060/121] Revert previous two commits - pushed by mistake --- docs/pages/release_notes.md | 2 -- .../UnsynchronizedStaticFormatterRule.java | 19 +++++++------------ .../xml/ConstructorCallsOverridableMethod.xml | 19 ------------------- .../xml/UnsynchronizedStaticFormatter.xml | 17 ----------------- 4 files changed, 7 insertions(+), 50 deletions(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 2015e6d46a..44f8bf9e73 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -41,8 +41,6 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources -* java-multithreading - * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer ### ๐Ÿšจ API Changes diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java index f6487b15f6..152492fdb3 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java @@ -8,15 +8,14 @@ import java.text.Format; import java.util.Arrays; import java.util.List; +import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTClassType; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; -import net.sourceforge.pmd.lang.java.ast.ASTInitializer; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTSynchronizedStatement; -import net.sourceforge.pmd.lang.java.ast.ASTType; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.ast.JModifier; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; @@ -63,13 +62,12 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule if (!node.hasModifiers(JModifier.STATIC)) { return data; } - ASTType cit = node.getTypeNode(); - if (!(cit instanceof ASTClassType) - || !TypeTestUtil.isA(formatterClassToCheck, cit)) { + ASTClassType cit = node.descendants(ASTClassType.class).first(); + if (cit == null || !TypeTestUtil.isA(formatterClassToCheck, cit)) { return data; } - ASTVariableId var = node.getVarIds().firstOrThrow(); + ASTVariableId var = node.descendants(ASTVariableId.class).first(); for (String formatter: THREAD_SAFE_FORMATTER) { if (TypeTestUtil.isA(formatter, var)) { return data; @@ -85,6 +83,8 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule continue; } + Node n = ref; + // is there a block-level synch? ASTSynchronizedStatement syncStatement = ref.ancestors(ASTSynchronizedStatement.class).first(); if (syncStatement != null) { @@ -102,12 +102,7 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule } } - boolean hasStaticInit = ref.ancestors(ASTInitializer.class).any(ASTInitializer::isStatic); - if (hasStaticInit) { - continue; - } - - asCtx(data).addViolation(ref); + asCtx(data).addViolation(n); } return data; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml index 0281087dec..5581a7b041 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/ConstructorCallsOverridableMethod.xml @@ -629,25 +629,6 @@ class Foo1 { } public void bar() {} } -]]> - - - [java] ConstructorCallsOverridableMethod: false positive with lombok's @Value #4510 - 0 - diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml index e6eea9edaf..c9012e95eb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml @@ -304,21 +304,4 @@ public class Foo { } ]]> - - [java] False positive UnsynchronizedStaticFormatter in static initializer #2368 - 0 - - From 228a1f5017d4f6b8715607bb534736338c41cf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 17:18:11 +0200 Subject: [PATCH 061/121] [java] Fix #2368 - UnsynchronizedStaticFormatter FP in static initializer --- .../UnsynchronizedStaticFormatterRule.java | 19 ++++++++++++------- .../xml/UnsynchronizedStaticFormatter.xml | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java index 152492fdb3..f6487b15f6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/UnsynchronizedStaticFormatterRule.java @@ -8,14 +8,15 @@ import java.text.Format; import java.util.Arrays; import java.util.List; -import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.ASTNamedReferenceExpr; import net.sourceforge.pmd.lang.java.ast.ASTClassType; import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; +import net.sourceforge.pmd.lang.java.ast.ASTInitializer; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTSynchronizedStatement; +import net.sourceforge.pmd.lang.java.ast.ASTType; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.ast.JModifier; import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; @@ -62,12 +63,13 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule if (!node.hasModifiers(JModifier.STATIC)) { return data; } - ASTClassType cit = node.descendants(ASTClassType.class).first(); - if (cit == null || !TypeTestUtil.isA(formatterClassToCheck, cit)) { + ASTType cit = node.getTypeNode(); + if (!(cit instanceof ASTClassType) + || !TypeTestUtil.isA(formatterClassToCheck, cit)) { return data; } - ASTVariableId var = node.descendants(ASTVariableId.class).first(); + ASTVariableId var = node.getVarIds().firstOrThrow(); for (String formatter: THREAD_SAFE_FORMATTER) { if (TypeTestUtil.isA(formatter, var)) { return data; @@ -83,8 +85,6 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule continue; } - Node n = ref; - // is there a block-level synch? ASTSynchronizedStatement syncStatement = ref.ancestors(ASTSynchronizedStatement.class).first(); if (syncStatement != null) { @@ -102,7 +102,12 @@ public class UnsynchronizedStaticFormatterRule extends AbstractJavaRulechainRule } } - asCtx(data).addViolation(n); + boolean hasStaticInit = ref.ancestors(ASTInitializer.class).any(ASTInitializer::isStatic); + if (hasStaticInit) { + continue; + } + + asCtx(data).addViolation(ref); } return data; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml index c9012e95eb..e6eea9edaf 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/multithreading/xml/UnsynchronizedStaticFormatter.xml @@ -304,4 +304,21 @@ public class Foo { } ]]> + + [java] False positive UnsynchronizedStaticFormatter in static initializer #2368 + 0 + + From 8f23cbb55620f6f31b2cba6cec619ef35e7cbe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Mon, 13 May 2024 17:19:39 +0200 Subject: [PATCH 062/121] Update release notes --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..2015e6d46a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -41,6 +41,8 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources +* java-multithreading + * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer ### ๐Ÿšจ API Changes From fc24eced58a851b0b4266ce6099033616e89c83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 14 May 2024 12:28:57 +0200 Subject: [PATCH 063/121] Fix #4903 - UnnecessaryBoxing where explicit conversion is necessary --- .../rule/codestyle/UnnecessaryBoxingRule.java | 43 ++++++++++--------- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 24 +++++++++++ 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index f603b9b66c..27b45b6279 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -54,7 +54,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { } JTypeMirror argT = arg.getTypeMirror(); if (argT.isPrimitive()) { - checkBox((RuleContext) data, "boxing", node, arg, node.getMethodType().getFormalParameters().get(0)); + checkBox((RuleContext) data, "boxing", node, arg); } } return null; @@ -73,11 +73,11 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { ASTExpression qualifier = node.getQualifier(); if (isValueOf && isWrapperValueOf(m)) { - checkBox((RuleContext) data, "boxing", node, node.getArguments().get(0), m.getFormalParameters().get(0)); + checkBox((RuleContext) data, "boxing", node, node.getArguments().get(0)); } else if (isValueOf && isStringValueOf(m) && qualifier != null) { checkUnboxing((RuleContext) data, node, qualifier.getTypeMirror()); } else if (!isValueOf && isUnboxingCall(m) && qualifier != null) { - checkBox((RuleContext) data, "unboxing", node, qualifier, qualifier.getTypeMirror()); + checkBox((RuleContext) data, "unboxing", node, qualifier); } } return null; @@ -105,8 +105,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { RuleContext rctx, String opKind, ASTExpression conversionExpr, - ASTExpression convertedExpr, - JTypeMirror conversionInput + ASTExpression convertedExpr ) { // the conversion looks like // CTX _ = conversion(sourceExpr) @@ -120,13 +119,14 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { // we want to report a violation if this is equivalent to // sourceExpr -> ctx - // which basically means testing that convInput -> convOutput + // which basically means testing that sourceExpr -> convOutput // may be performed implicitly. // We cannot just test compatibility of the source to the ctx, // because of situations like // int i = integer.byteValue() - // where the conversion actually truncates the input value. + // where the conversion actually truncates the input value + // (here we do sourceExpr=Integer (-> convInput=Integer) -> convOutput=byte -> ctx=int). JTypeMirror sourceType = convertedExpr.getTypeMirror(); JTypeMirror conversionOutput = conversionExpr.getTypeMirror(); @@ -138,23 +138,21 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { if (ctxType != null) { - if (isImplicitlyConvertible(conversionInput, conversionOutput)) { - - boolean simpleConv = isReferenceSubtype(sourceType, conversionInput); + if (isImplicitlyConvertible(sourceType, conversionOutput)) { final String reason; - if (simpleConv && conversionInput.unbox().equals(conversionOutput)) { - reason = "explicit unboxing"; - } else if (simpleConv && conversionInput.box().equals(conversionOutput)) { - reason = "explicit boxing"; - } else if (sourceType.equals(conversionOutput)) { + if (sourceType.equals(conversionOutput)) { reason = "boxing of boxed value"; + } else if (sourceType.unbox().equals(conversionOutput)) { + reason = "explicit unboxing"; + } else if (sourceType.box().equals(conversionOutput)) { + reason = "explicit boxing"; + } else if (sourceType.equals(ctxType)) { + reason = opKind; } else { - if (sourceType.equals(ctxType)) { - reason = opKind; - } else { - reason = "explicit conversion from " + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); - } + reason = "explicit conversion from " + + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); } rctx.addViolation(conversionExpr, reason); @@ -185,6 +183,11 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { } private boolean isImplicitlyConvertible(JTypeMirror i, JTypeMirror o) { + if (i.isBoxedPrimitive() && o.isBoxedPrimitive()) { + // There is no implicit conversions between box types, + // only between primitives + return i.equals(o); + } return i.box().isSubtypeOf(o.box()) || i.unbox().isSubtypeOf(o.unbox()); } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index d891877022..a7b46cdccb 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -333,4 +333,28 @@ public class Foo { } ]]> + + [java] UnnecessaryBoxing, but explicit conversion is necessary #4903 + 0 + + From 4472521605eb6516d4d51025f96a9aba77eea9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 14 May 2024 09:21:35 -0300 Subject: [PATCH 064/121] Update changelog, refs #5006 --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..86a6d417a5 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -34,6 +34,7 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration + * [#5006](https://github.com/pmd/pmd/issues/5006): \[java] Bad intersection, unrelated class types Child and Parent * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4852](https://github.com/pmd/pmd/issues/4852): \[java] ReplaceVectorWithList false-positive (neither Vector nor List usage) From 746f64f8e2ec616c4a0ef91440369c318ac97e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 14 May 2024 09:25:16 -0300 Subject: [PATCH 065/121] Update changelog, refs #4042 --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..03d2d765d6 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -41,6 +41,8 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources +* java-errorprone + * [#4042](https://github.com/pmd/pmd/issues/4042): \[java] A false negative about the rule StringBufferInstantiationWithChar ### ๐Ÿšจ API Changes From c42330d0d9d209d72750761a547bde9c21c4b38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 14 May 2024 16:37:48 +0200 Subject: [PATCH 066/121] Add more doc --- .../java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java index fc06aee527..d4ac31e317 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java @@ -132,6 +132,11 @@ public final class ASTClassType extends AbstractJavaTypeNode implements ASTRefer * if the auxclasspath is not complete, and the qualifier could not * be disambiguated, this method will return null (and an AmbiguousName * will stay in the tree). + * If a nested type is package-qualified, this method will only return a non-null result for + * the leftmost (=innermost) ASTClassType node. For instance in {@code java.util.Map.Entry}, + * the node {@code java.util.Map} has package qualifier {@code "java.util"}, while the node for {@code Entry} + * has package qualifier {@code null}. Note that the {@linkplain JClassSymbol#getPackageName() package name} + * of the symbol and type mirror will reflect that package name anyway, on both nodes. */ public @Nullable String getPackageQualifier() { if (isFullyQualified()) { From feddca0f4a6e839d5856358060067ab1745f7862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Tue, 14 May 2024 12:03:58 -0300 Subject: [PATCH 067/121] Remove empty paragraph --- .../java/rule/performance/InefficientEmptyStringCheckRule.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckRule.java index b843d7b51b..a6b68688d5 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/performance/InefficientEmptyStringCheckRule.java @@ -13,7 +13,6 @@ import net.sourceforge.pmd.lang.java.types.TypeTestUtil; /** * This rule finds code which inefficiently determines empty strings. * - *

*

  * str.trim().length()==0
  * 
From 625fb36b14ecb450519506743471ed2f51278f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 14 May 2024 13:25:44 +0200 Subject: [PATCH 068/121] Fix #4924 - UnnecessaryBoxing FP in lambda Change a bit the behavior for some test cases. Previously the rule reported necessary boxing that could be simplified another way, but that is an edge case and not worth complexifying the rule --- .../lang/java/ast/internal/JavaAstUtils.java | 21 ++++++++++ .../rule/codestyle/UnnecessaryBoxingRule.java | 20 ++++----- .../pmd/lang/java/types/TypeOps.java | 20 +++++++++ .../pmd/lang/java/types/ast/ExprContext.java | 2 +- .../types/ast/internal/PolyResolution.java | 38 +++++++++-------- .../java/types/ast/ConversionContextTests.kt | 39 +++++++++++++++++- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 41 ++++++++++++++----- 7 files changed, 139 insertions(+), 42 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java index f71a5c1a7e..31149fc70c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/JavaAstUtils.java @@ -37,7 +37,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTBreakStatement; import net.sourceforge.pmd.lang.java.ast.ASTCastExpression; import net.sourceforge.pmd.lang.java.ast.ASTCatchClause; import net.sourceforge.pmd.lang.java.ast.ASTClassType; +import net.sourceforge.pmd.lang.java.ast.ASTCompactConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; +import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTExecutableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTExplicitConstructorInvocation; import net.sourceforge.pmd.lang.java.ast.ASTExpression; @@ -49,6 +51,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters; import net.sourceforge.pmd.lang.java.ast.ASTInfixExpression; import net.sourceforge.pmd.lang.java.ast.ASTInitializer; import net.sourceforge.pmd.lang.java.ast.ASTLabeledStatement; +import net.sourceforge.pmd.lang.java.ast.ASTLambdaExpression; import net.sourceforge.pmd.lang.java.ast.ASTList; import net.sourceforge.pmd.lang.java.ast.ASTLocalVariableDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTLoopStatement; @@ -56,6 +59,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTNullLiteral; import net.sourceforge.pmd.lang.java.ast.ASTNumericLiteral; +import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement; import net.sourceforge.pmd.lang.java.ast.ASTStatement; import net.sourceforge.pmd.lang.java.ast.ASTSuperExpression; import net.sourceforge.pmd.lang.java.ast.ASTSwitchBranch; @@ -802,4 +806,21 @@ public final class JavaAstUtils { || it instanceof ASTExplicitConstructorInvocation ); } + + + /** + * Return the target of the return. May be an {@link ASTMethodDeclaration}, + * {@link ASTLambdaExpression}, {@link ASTInitializer}, + * {@link ASTConstructorDeclaration} or {@link ASTCompactConstructorDeclaration}. + * + */ + public static @Nullable JavaNode getReturnTarget(ASTReturnStatement stmt) { + return stmt.ancestors().first( + it -> it instanceof ASTMethodDeclaration + || it instanceof ASTLambdaExpression + || it instanceof ASTConstructorDeclaration + || it instanceof ASTInitializer + || it instanceof ASTCompactConstructorDeclaration + ); + } } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 27b45b6279..381c4ff3d7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -12,9 +12,9 @@ import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTExpression; +import net.sourceforge.pmd.lang.java.ast.ASTExpressionStatement; import net.sourceforge.pmd.lang.java.ast.ASTList; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; -import net.sourceforge.pmd.lang.java.ast.InvocationNode; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.types.JMethodSig; import net.sourceforge.pmd.lang.java.types.JTypeMirror; @@ -132,7 +132,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { JTypeMirror conversionOutput = conversionExpr.getTypeMirror(); ExprContext ctx = conversionExpr.getConversionContext(); JTypeMirror ctxType = ctx.getTargetType(); - if (ctxType == null && conversionExpr instanceof InvocationNode) { + if (ctxType == null && conversionExpr.getParent() instanceof ASTExpressionStatement) { ctxType = conversionOutput; } @@ -140,7 +140,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { if (isImplicitlyConvertible(sourceType, conversionOutput)) { - final String reason; + String reason; if (sourceType.equals(conversionOutput)) { reason = "boxing of boxed value"; } else if (sourceType.unbox().equals(conversionOutput)) { @@ -153,6 +153,9 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { reason = "explicit conversion from " + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); + if (!conversionOutput.equals(ctxType)) { + reason += " through " + TypePrettyPrint.prettyPrintWithSimpleNames(conversionOutput); + } } rctx.addViolation(conversionExpr, reason); @@ -160,6 +163,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { } } + private void checkUnboxing( RuleContext rctx, ASTMethodCall methodCall, @@ -192,14 +196,4 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { || i.unbox().isSubtypeOf(o.unbox()); } - /** - * Whether {@code S <: T}, but ignoring primitive widening. - * {@code isReferenceSubtype(int, double) == false} even though - * {@code int.isSubtypeOf(double)}. - */ - private static boolean isReferenceSubtype(JTypeMirror s, JTypeMirror t) { - return s.isPrimitive() ? t.equals(s) - : s.isSubtypeOf(t); - } - } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 0398a5c2d8..5104bbedfa 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -2075,5 +2075,25 @@ public final class TypeOps { return t instanceof JArrayType ? ((JArrayType) t).getComponentType() : null; } + + /** + * Return true if the method is context dependent. That + * means its return type is influenced by the surrounding + * context during type inference. Generic constructors + * are always context dependent. + */ + public static boolean isContextDependent(JMethodSig sig) { + JExecutableSymbol symbol = sig.getSymbol(); + if (symbol.isGeneric() || symbol.getEnclosingClass().isGeneric()) { + if (symbol instanceof JMethodSymbol) { + JTypeMirror returnType = ((JMethodSymbol) symbol).getReturnType(EMPTY); + return mentionsAny(returnType, symbol.getTypeParameters()) + || mentionsAny(returnType, symbol.getEnclosingClass().getTypeParameters()); + } + // generic ctors are context dependent + return true; + } + return false; + } // } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java index 15912b4083..ac11aa1107 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/ExprContext.java @@ -130,7 +130,7 @@ public abstract class ExprContext { * Assignment context. This includes: *
    *
  • RHS of an assignment - *
  • Return statement + *
  • Return statement or return expression of a lambda *
  • Array initializer *
  • Superclass constructor invocation *
diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index 1f6142aa1e..e6ac760193 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -20,7 +20,6 @@ import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.java.ast.ASTArgumentList; import net.sourceforge.pmd.lang.java.ast.ASTArrayAccess; import net.sourceforge.pmd.lang.java.ast.ASTArrayInitializer; @@ -44,7 +43,6 @@ import net.sourceforge.pmd.lang.java.ast.ASTSwitchExpression; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLabel; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLike; import net.sourceforge.pmd.lang.java.ast.ASTType; -import net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclarator; import net.sourceforge.pmd.lang.java.ast.ASTVoidType; import net.sourceforge.pmd.lang.java.ast.ASTYieldStatement; @@ -361,29 +359,24 @@ public final class PolyResolution { } private static @Nullable JTypeMirror returnTargetType(ASTReturnStatement context) { - Node methodDecl = - context.ancestors().first( - it -> it instanceof ASTMethodDeclaration - || it instanceof ASTLambdaExpression - || it instanceof ASTTypeDeclaration - ); + JavaNode methodDecl = JavaAstUtils.getReturnTarget(context); - if (methodDecl == null || methodDecl instanceof ASTTypeDeclaration) { - // in initializer, or constructor decl, return with expression is forbidden - // (this is an error) - return null; - } else if (methodDecl instanceof ASTLambdaExpression) { + if (methodDecl instanceof ASTLambdaExpression) { // return within a lambda // "assignment context", deferred to lambda inference JMethodSig fun = ((ASTLambdaExpression) methodDecl).getFunctionalMethod(); return fun == null ? null : fun.getReturnType(); - } else { + } else if (methodDecl instanceof ASTMethodDeclaration) { @NonNull ASTType resultType = ((ASTMethodDeclaration) methodDecl).getResultTypeNode(); return resultType instanceof ASTVoidType ? null // (this is an error) : resultType.getTypeMirror(); } + // Return within ctor or initializer or the like, + // return with value is disallowed. This is an error. + return null; } + /** * Returns the node on which the type of the given node depends. * This addresses the fact that poly expressions depend on their @@ -477,6 +470,7 @@ public final class PolyResolution { return newAssignmentCtx(returnTargetType((ASTReturnStatement) papa)); + } else if (papa instanceof ASTVariableDeclarator && !((ASTVariableDeclarator) papa).getVarId().isTypeInferred()) { @@ -520,6 +514,19 @@ public final class PolyResolution { return node.getIndexInParent() == 0 ? booleanCtx // condition : stringCtx; // message + } else if (papa instanceof ASTLambdaExpression && node.getIndexInParent() == 1) { + // lambda expression body + + + JMethodSig fun = ((ASTLambdaExpression) papa).getFunctionalMethod(); + if (fun == null || TypeOps.isContextDependent(fun)) { + // Missing context, because the expression type itself + // is used to infer the context type. + return ExprContext.getMissingInstance(); + } + return newAssignmentCtx(fun.getReturnType()); + + } else if (papa instanceof ASTIfStatement || papa instanceof ASTLoopStatement && !(papa instanceof ASTForeachStatement)) { @@ -611,8 +618,7 @@ public final class PolyResolution { return node instanceof ASTSwitchExpression && child.getIndexInParent() != 0 // not the condition || node instanceof ASTSwitchArrowBranch || node instanceof ASTConditionalExpression && child.getIndexInParent() != 0 // not the condition - // lambdas "forward the context" when you have nested lambdas, eg: `x -> y -> f(x, y)` - || node instanceof ASTLambdaExpression && child.getIndexInParent() == 1; // the body expression + || internalUse && node instanceof ASTLambdaExpression && child.getIndexInParent() == 1; } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 03ae05f13e..1a67878e70 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -7,13 +7,16 @@ package net.sourceforge.pmd.lang.java.types.ast import io.kotest.assertions.withClue import io.kotest.matchers.shouldBe -import net.sourceforge.pmd.lang.test.ast.component6 -import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils import net.sourceforge.pmd.lang.java.types.STRING +import net.sourceforge.pmd.lang.java.types.TypeTestUtil +import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.ASSIGNMENT +import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.INVOCATION import net.sourceforge.pmd.lang.java.types.parseWithTypeInferenceSpy import net.sourceforge.pmd.lang.java.types.shouldHaveType +import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.shouldBe class ConversionContextTests : ProcessorTestSpec({ @@ -268,4 +271,36 @@ class ConversionContextTests : ProcessorTestSpec({ l1.rightOperand.conversionContext::getTargetType shouldBe long } } + + parserTest("Lambda ctx") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + class Foo { + record Item(int cents) {} + Object map(Item item) { + // here the conversion is necessary to determine the context type + return map(item, it -> Long.valueOf(it.cents())); + } + Object map2(Item item) { + // here it is not necessary + return mapToLong(item, it -> Long.valueOf(it.cents())); + } + interface Fun { R apply(T t); } + interface ToLongFun { long apply(T t); } + R map(T t, Fun fun) {} + long mapToLong(T t, ToLongFun fun) {} + } + """) + + val (lambda, lambdaToLong) = acu.descendants(ASTLambdaExpression::class.java).toList() + + spy.shouldBeOk { + lambda.expressionBody!!.conversionContext shouldBe ExprContext.getMissingInstance() + + lambdaToLong.expressionBody!!.conversionContext::getTargetType shouldBe long + lambdaToLong.expressionBody!!.conversionContext::getKind shouldBe ASSIGNMENT + + lambda.conversionContext::getKind shouldBe INVOCATION + } + } }) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index a7b46cdccb..1fa269aeab 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -96,7 +96,7 @@ public class Foo {{ Unnecessary explicit unboxing Unnecessary explicit conversion from Integer to double - Unnecessary explicit conversion from Integer to double + Unnecessary explicit conversion from Integer to double through long Patch 2075906: Add toString() to the rule UnnecessaryWrapperObjectCreation - 1 - - Unnecessary explicit boxing - + 0 #1057 False positive for UnnecessaryWrapperObjectCreation - 1 - 3 - - Unnecessary explicit conversion from int to Float - + 0 + + [java] UnnecessaryBoxing FP in lambda + 1 + 11 + + Unnecessary explicit conversion from int to long through Long + + Long.valueOf(it.cents())); + } + Object map2(Item item) { + // here it is not necessary + return mapToLong(item, it -> Long.valueOf(it.cents())); + } + interface Fun { R apply(T t); } + interface ToLongFun { long apply(T t); } + R map(T t, Fun fun) {} + long mapToLong(T t, ToLongFun fun) {} + } + ]]> + From 3ec3903425897f80f455f86a2bae77165496fa5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 14 May 2024 22:50:22 +0200 Subject: [PATCH 069/121] Fix javadoc error --- .../pmd/lang/java/ast/ASTClassType.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java index d4ac31e317..0fd3c90229 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTClassType.java @@ -7,6 +7,7 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; +import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.JTypeDeclSymbol; import net.sourceforge.pmd.lang.java.types.JClassType; import net.sourceforge.pmd.util.AssertionUtil; @@ -132,11 +133,16 @@ public final class ASTClassType extends AbstractJavaTypeNode implements ASTRefer * if the auxclasspath is not complete, and the qualifier could not * be disambiguated, this method will return null (and an AmbiguousName * will stay in the tree). - * If a nested type is package-qualified, this method will only return a non-null result for - * the leftmost (=innermost) ASTClassType node. For instance in {@code java.util.Map.Entry}, - * the node {@code java.util.Map} has package qualifier {@code "java.util"}, while the node for {@code Entry} - * has package qualifier {@code null}. Note that the {@linkplain JClassSymbol#getPackageName() package name} - * of the symbol and type mirror will reflect that package name anyway, on both nodes. + * + *

If a nested type is package-qualified, this method + * will only return a non-null result for the leftmost (=innermost) + * ASTClassType node. For instance in {@code java.util.Map.Entry}, + * the node {@code java.util.Map} has package qualifier + * {@code "java.util"}, while the node for {@code Entry} + * has package qualifier {@code null}. Note that the + * {@linkplain JClassSymbol#getPackageName() package name} + * of the symbol and type mirror will reflect that package + * name anyway, on both nodes. */ public @Nullable String getPackageQualifier() { if (isFullyQualified()) { From 7341e3c880a852d82af36d6b4b69cb37c1f5fabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 15 May 2024 09:19:33 +0200 Subject: [PATCH 070/121] Add version check --- .../net/sourceforge/pmd/lang/java/ast/ASTVariableId.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java index a5d03005e0..29ceca7c17 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java @@ -130,10 +130,12 @@ public final class ASTVariableId extends AbstractTypedSymbolDeclarator= 0; } /** Returns the name of the variable. */ From 4cfe90cfdcacfd7e1c2789ec0253a2d2f1c85dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 15 May 2024 09:36:39 +0200 Subject: [PATCH 071/121] Cleanup symtable factory --- .../pmd/lang/ast/internal/StreamImpl.java | 5 ++++ .../pmd/lang/java/ast/ASTVariableId.java | 2 +- .../table/coreimpl/ShadowChainBuilder.java | 9 ++++--- .../table/internal/SymTableFactory.java | 27 ++++++++----------- .../table/internal/SymbolTableResolver.java | 6 ++--- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/internal/StreamImpl.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/internal/StreamImpl.java index dbeb481a37..66035b5b0d 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/internal/StreamImpl.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/internal/StreamImpl.java @@ -101,6 +101,11 @@ public final class StreamImpl { } } + @Override + public List toList() { + return Collections.unmodifiableList(Arrays.asList(array)); + } + @Override protected Iterator baseIterator() { return Arrays.asList(array).iterator(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java index 29ceca7c17..4e100e9a74 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java @@ -135,7 +135,7 @@ public final class ASTVariableId extends AbstractTypedSymbolDeclarator= 0; + return "_".equals(name) && getLanguageVersion().compareToVersion("21-preview") >= 0; } /** Returns the name of the variable. */ diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/coreimpl/ShadowChainBuilder.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/coreimpl/ShadowChainBuilder.java index ad4e25cb30..c24d63e500 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/coreimpl/ShadowChainBuilder.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/coreimpl/ShadowChainBuilder.java @@ -17,9 +17,11 @@ import java.util.Map.Entry; import java.util.function.BinaryOperator; import java.util.function.Function; +import org.checkerframework.checker.nullness.qual.Nullable; + import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.MostlySingularMultimap.Builder; import net.sourceforge.pmd.lang.java.symbols.table.coreimpl.MostlySingularMultimap.MapMaker; -import net.sourceforge.pmd.util.CollectionUtil; +import net.sourceforge.pmd.util.IteratorUtil; /** * Build a shadow chain for some type. @@ -126,8 +128,9 @@ public abstract class ShadowChainBuilder { // convenience to build name resolvers - public ResolverBuilder groupByName(Iterable input, Function symbolFetcher) { - return new ResolverBuilder(newMapBuilder().groupBy(CollectionUtil.map(input, symbolFetcher), this::getSimpleName)); + public ResolverBuilder groupByName(Iterable input, Function symbolFetcher) { + Iterable mapped = () -> IteratorUtil.mapNotNull(input.iterator(), symbolFetcher); + return new ResolverBuilder(newMapBuilder().groupBy(mapped, this::getSimpleName)); } public ResolverBuilder groupByName(Iterable tparams) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java index 680679ba46..eb15e316dc 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/table/internal/SymTableFactory.java @@ -23,7 +23,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.SemanticErrorReporter; -import net.sourceforge.pmd.lang.java.ast.ASTFormalParameter; import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters; import net.sourceforge.pmd.lang.java.ast.ASTImportDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTList; @@ -366,13 +365,13 @@ final class SymTableFactory { * of fields by local variables and formals. */ JSymbolTable bodyDeclaration(JSymbolTable parent, JClassType enclosing, @Nullable ASTFormalParameters formals, @Nullable ASTTypeParameters tparams) { - NodeStream namedFormals = ASTList.orEmptyStream(formals).map(ASTFormalParameter::getVarId); - if (unnamedVariableIsSupported()) { - namedFormals = namedFormals.filterNot(ASTVariableId::isUnnamed); - } return new SymbolTableImpl( - VARS.shadow(varNode(parent), ScopeInfo.FORMAL_PARAM, VARS.groupByName(namedFormals, fp -> { - JVariableSymbol sym = fp.getSymbol(); + VARS.shadow(varNode(parent), ScopeInfo.FORMAL_PARAM, VARS.groupByName(ASTList.orEmptyStream(formals), fp -> { + ASTVariableId varId = fp.getVarId(); + if (varId.isUnnamed()) { + return null; + } + JVariableSymbol sym = varId.getSymbol(); return sym.getTypeSystem().sigOf(enclosing, (JFormalParamSymbol) sym); })), TYPES.shadow(typeNode(parent), ScopeInfo.TYPE_PARAM, TYPES.groupByName(ASTList.orEmptyStream(tparams), ASTTypeParameter::getTypeMirror)), @@ -391,7 +390,7 @@ final class SymTableFactory { JSymbolTable localVarSymTable(JSymbolTable parent, JClassType enclosing, Iterable ids) { List sigs = new ArrayList<>(); for (ASTVariableId id : ids) { - if (unnamedVariableIsSupported() && id.isUnnamed()) { + if (id.isUnnamed()) { continue; } sigs.add(id.getTypeSystem().sigOf(enclosing, (JLocalVariableSymbol) id.getSymbol())); @@ -399,16 +398,12 @@ final class SymTableFactory { return SymbolTableImpl.withVars(parent, VARS.augment(varNode(parent), false, ScopeInfo.LOCAL, VARS.groupByName(sigs))); } - JSymbolTable localVarSymTable(JSymbolTable parent, JClassType enclosing, JVariableSymbol id) { - if (unnamedVariableIsSupported() && "_".equals(id.getSimpleName())) { - // unnamed variable + JSymbolTable localVarSymTable(JSymbolTable parent, JClassType enclosing, ASTVariableId id) { + assert !id.isField(); + if (id.isUnnamed()) { // checks language version already return parent; } - return SymbolTableImpl.withVars(parent, VARS.augment(varNode(parent), false, ScopeInfo.LOCAL, id.getTypeSystem().sigOf(enclosing, (JLocalVariableSymbol) id))); - } - - private boolean unnamedVariableIsSupported() { - return processor.getJdkVersion() >= 22; + return SymbolTableImpl.withVars(parent, VARS.augment(varNode(parent), false, ScopeInfo.LOCAL, id.getTypeSystem().sigOf(enclosing, (JLocalVariableSymbol) id.getSymbol()))); } JSymbolTable localTypeSymTable(JSymbolTable parent, JClassType sym) { 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 f7679a49e3..72f095e2fd 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 @@ -428,7 +428,7 @@ public final class SymbolTableResolver { int pushed = 0; for (ASTVariableDeclarator declarator : st.children(ASTVariableDeclarator.class)) { ASTVariableId varId = declarator.getVarId(); - pushed += pushOnStack(f.localVarSymTable(top(), enclosing(), varId.getSymbol())); + pushed += pushOnStack(f.localVarSymTable(top(), enclosing(), varId)); // visit initializer setTopSymbolTableAndVisit(declarator.getInitializer(), ctx); } @@ -443,7 +443,7 @@ public final class SymbolTableResolver { ASTVariableId varId = node.getVarId(); setTopSymbolTableAndVisit(varId.getTypeNode(), ctx); - int pushed = pushOnStack(f.localVarSymTable(top(), enclosing(), varId.getSymbol())); + int pushed = pushOnStack(f.localVarSymTable(top(), enclosing(), varId)); ASTStatement body = node.getBody(); // unless it's a block the body statement may never set a // symbol table that would have this table as parent, @@ -479,7 +479,7 @@ public final class SymbolTableResolver { @Override public Void visit(ASTCatchClause node, @NonNull ReferenceCtx ctx) { - int pushed = pushOnStack(f.localVarSymTable(top(), enclosing(), node.getParameter().getVarId().getSymbol())); + int pushed = pushOnStack(f.localVarSymTable(top(), enclosing(), node.getParameter().getVarId())); setTopSymbolTableAndVisitAllChildren(node, ctx); popStack(pushed); return null; From eb17c9aab73bdb7ce1f1c11993fdf1befc0a2311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 15 May 2024 20:15:29 +0200 Subject: [PATCH 072/121] Fix many problems with UnnecessaryBoxing --- .../rule/codestyle/UnnecessaryBoxingRule.java | 111 +++++++++++++----- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 76 ++++++++++-- 2 files changed, 150 insertions(+), 37 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 381c4ff3d7..20adcb7e36 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -9,12 +9,14 @@ import static net.sourceforge.pmd.util.CollectionUtil.setOf; import java.util.Set; import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTExpression; -import net.sourceforge.pmd.lang.java.ast.ASTExpressionStatement; import net.sourceforge.pmd.lang.java.ast.ASTList; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; +import net.sourceforge.pmd.lang.java.ast.JavaNode; +import net.sourceforge.pmd.lang.java.ast.QualifiableExpression; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.types.JMethodSig; import net.sourceforge.pmd.lang.java.types.JTypeMirror; @@ -54,7 +56,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { } JTypeMirror argT = arg.getTypeMirror(); if (argT.isPrimitive()) { - checkBox((RuleContext) data, "boxing", node, arg); + checkBox((RuleContext) data, node, arg); } } return null; @@ -73,18 +75,19 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { ASTExpression qualifier = node.getQualifier(); if (isValueOf && isWrapperValueOf(m)) { - checkBox((RuleContext) data, "boxing", node, node.getArguments().get(0)); - } else if (isValueOf && isStringValueOf(m) && qualifier != null) { - checkUnboxing((RuleContext) data, node, qualifier.getTypeMirror()); - } else if (!isValueOf && isUnboxingCall(m) && qualifier != null) { - checkBox((RuleContext) data, "unboxing", node, qualifier); + checkBox((RuleContext) data, node, node.getArguments().get(0)); + } else if (isValueOf && isBoxValueOfString(m)) { + checkUnboxing((RuleContext) data, node, m.getDeclaringType()); + } else if (!isValueOf && qualifier != null && isUnboxingCall(m)) { + checkBox((RuleContext) data, node, qualifier); } } return null; } private boolean isUnboxingCall(JMethodSig m) { - return !m.isStatic() && m.getDeclaringType().isBoxedPrimitive() && m.getArity() == 0; + return !m.isStatic() && m.getDeclaringType().isBoxedPrimitive() && m.getArity() == 0 + && m.getReturnType().isPrimitive(); } private boolean isWrapperValueOf(JMethodSig m) { @@ -94,7 +97,8 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { && m.getFormalParameters().get(0).isPrimitive(); } - private boolean isStringValueOf(JMethodSig m) { + private boolean isBoxValueOfString(JMethodSig m) { + // eg Integer.valueOf("2") return m.isStatic() && (m.getArity() == 1 || m.getArity() == 2) && m.getDeclaringType().isBoxedPrimitive() @@ -103,7 +107,6 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { private void checkBox( RuleContext rctx, - String opKind, ASTExpression conversionExpr, ASTExpression convertedExpr ) { @@ -119,8 +122,10 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { // we want to report a violation if this is equivalent to // sourceExpr -> ctx - // which basically means testing that sourceExpr -> convOutput - // may be performed implicitly. + // which means testing that + // 1. the result of the implicit conversion of sourceExpr + // with context type ctx is the same type as the result of conversion 3 + // 2. conversion 2 does not truncate the value // We cannot just test compatibility of the source to the ctx, // because of situations like @@ -132,35 +137,49 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { JTypeMirror conversionOutput = conversionExpr.getTypeMirror(); ExprContext ctx = conversionExpr.getConversionContext(); JTypeMirror ctxType = ctx.getTargetType(); - if (ctxType == null && conversionExpr.getParent() instanceof ASTExpressionStatement) { - ctxType = conversionOutput; + + if (sourceType.isPrimitive() + && !conversionOutput.isPrimitive() + && ctxType == null + && isObjectConversionNecessary(conversionExpr)) { + // eg Integer.valueOf(2).equals(otherInteger) + return; } - if (ctxType != null) { - - if (isImplicitlyConvertible(sourceType, conversionOutput)) { - - String reason; - if (sourceType.equals(conversionOutput)) { - reason = "boxing of boxed value"; - } else if (sourceType.unbox().equals(conversionOutput)) { + String reason = null; + if (sourceType.equals(conversionOutput)) { + reason = "boxing of boxed value"; + } else if (ctxType != null) { + JTypeMirror conv = implicitConversionResult(sourceType, ctxType); + if (conv != null + && conv.equals(implicitConversionResult(conversionOutput, ctxType)) + && conversionDoesNotChangesValue(sourceType, conversionOutput)) { + if (sourceType.unbox().equals(conversionOutput)) { reason = "explicit unboxing"; } else if (sourceType.box().equals(conversionOutput)) { reason = "explicit boxing"; - } else if (sourceType.equals(ctxType)) { - reason = opKind; } else { - reason = "explicit conversion from " - + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + reason = "explicit conversion from " + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); if (!conversionOutput.equals(ctxType)) { reason += " through " + TypePrettyPrint.prettyPrintWithSimpleNames(conversionOutput); } } - - rctx.addViolation(conversionExpr, reason); } } + + if (reason != null) { + rctx.addViolation(conversionExpr, reason); + } + } + + + private boolean isObjectConversionNecessary(ASTExpression e) { + JavaNode parent = e.getParent(); + if (e.getIndexInParent() == 0) { + return parent instanceof QualifiableExpression; + } + return false; } @@ -191,9 +210,41 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { // There is no implicit conversions between box types, // only between primitives return i.equals(o); + } else if (i.isPrimitive() && o.isPrimitive()) { + return i.isSubtypeOf(o); + } else { + return i.unbox().equals(o.unbox()); } - return i.box().isSubtypeOf(o.box()) - || i.unbox().isSubtypeOf(o.unbox()); + } + + + /** + * Type of the converted i in context ctx. If no implicit + * conversion is possible then return null. + */ + private static @Nullable JTypeMirror implicitConversionResult(JTypeMirror i, JTypeMirror ctx) { + if (!ctx.isPrimitive()) { + // boxing + return i.box().isSubtypeOf(ctx) ? i.box() : null; + } else if (i.isBoxedPrimitive() && ctx.isPrimitive()) { + // Integer x = 1; + // long l = x; + // unboxing then optional widening + return i.unbox().isSubtypeOf(ctx) ? ctx : null; + } else if (i.isPrimitive() && ctx.isPrimitive()) { + // widening + return i.isSubtypeOf(ctx) ? ctx : null; + } + return null; + } + + + /** + * Whether the explicit conversion from i to o changes the value. + * This is e.g. truncating an integer. + */ + private static boolean conversionDoesNotChangesValue(JTypeMirror i, JTypeMirror o) { + return i.box().isSubtypeOf(o.box()) || i.unbox().isSubtypeOf(o.unbox()); } } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 1fa269aeab..692e80118c 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -62,12 +62,8 @@ public class Foo { ]]> - pos - new Integer(int) with widening - 1 - 3 - - Unnecessary explicit conversion from char to Integer - + neg - char -> Integer is not possible implicitly + 0 - [java] UnnecessaryBoxing FP in lambda + [java] UnnecessaryBoxing FP in lambda #4924 1 11 @@ -378,4 +374,70 @@ public class Foo { } ]]> + + If method is called on result then boxing is necessary + 1 + 5 + + Unnecessary boxing of boxed value + + + + + valueOf something else + 0 + + + + imported valueOf + 1 + + Unnecessary explicit boxing + + + + + Boxing to another type + 0 + + From ed18c9d746a815f29c6d7a311d3f74d0f5a5e878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 13:52:29 +0200 Subject: [PATCH 073/121] Fix PMD warning --- .../pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 20adcb7e36..603854b411 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -176,10 +176,7 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { private boolean isObjectConversionNecessary(ASTExpression e) { JavaNode parent = e.getParent(); - if (e.getIndexInParent() == 0) { - return parent instanceof QualifiableExpression; - } - return false; + return e.getIndexInParent() == 0 && parent instanceof QualifiableExpression; } From 42130835541e725b78ec64e5bb3bc486b4122518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 14:10:59 +0200 Subject: [PATCH 074/121] Remove redundant interface declarations in pmd-java Related to #4885 --- .../net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java | 2 +- .../net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java | 2 +- .../java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java | 3 +-- .../sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTCastExpression.java | 2 +- .../net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java | 3 +-- .../sourceforge/pmd/lang/java/ast/ASTConstructorCall.java | 6 +----- .../net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java | 5 ++--- .../pmd/lang/java/ast/ASTExecutableDeclaration.java | 2 -- .../net/sourceforge/pmd/lang/java/ast/ASTExpression.java | 6 +----- .../sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java | 4 +--- .../sourceforge/pmd/lang/java/ast/ASTFormalParameter.java | 5 +---- .../pmd/lang/java/ast/ASTLocalVariableDeclaration.java | 4 +--- .../net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java | 6 +----- .../sourceforge/pmd/lang/java/ast/ASTMethodReference.java | 3 +-- .../net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java | 2 +- .../pmd/lang/java/ast/ASTRecordComponentList.java | 4 +--- .../net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java | 2 +- .../sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java | 4 +--- .../net/sourceforge/pmd/lang/java/ast/ASTVariableId.java | 2 +- .../pmd/lang/java/ast/AbstractTypeBodyDeclaration.java | 2 +- .../sourceforge/pmd/lang/java/ast/InternalInterfaces.java | 2 +- .../pmd/lang/java/symbols/JAccessibleElementSymbol.java | 2 +- .../pmd/lang/java/symbols/JExecutableSymbol.java | 2 +- .../sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java | 2 +- .../lang/java/symbols/internal/ast/AstUnnamedClassSym.java | 3 +-- .../pmd/lang/java/types/BasePrimitiveSymbol.java | 3 +-- .../java/net/sourceforge/pmd/lang/java/types/JTypeVar.java | 2 +- .../pmd/lang/java/types/internal/infer/InferenceVar.java | 2 +- .../java/types/internal/infer/ast/MethodInvocMirror.java | 3 +-- .../java/types/internal/infer/ast/StandaloneExprMirror.java | 2 +- 34 files changed, 34 insertions(+), 66 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java index 69670a58ca..b3981ea8ad 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.types.JClassType; * * */ -public final class ASTAnnotation extends AbstractJavaTypeNode implements TypeNode, ASTMemberValue, Iterable { +public final class ASTAnnotation extends AbstractJavaTypeNode implements ASTMemberValue, Iterable { ASTAnnotation(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java index 367e3e9c63..a281c9e4b4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java @@ -17,7 +17,7 @@ package net.sourceforge.pmd.lang.java.ast; * * */ -public final class ASTArrayDimExpr extends ASTArrayTypeDim implements Annotatable { +public final class ASTArrayDimExpr extends ASTArrayTypeDim { ASTArrayDimExpr(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java index c51c510061..eea8f50e9a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java @@ -22,7 +22,7 @@ import java.util.Iterator; * * */ -public final class ASTArrayInitializer extends AbstractJavaExpr implements ASTExpression, Iterable { +public final class ASTArrayInitializer extends AbstractJavaExpr implements Iterable { ASTArrayInitializer(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java index 0461ca3a3d..605b264c7c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken; import net.sourceforge.pmd.lang.java.ast.ASTList.ASTMaybeEmptyListOf; -import net.sourceforge.pmd.lang.java.ast.InternalInterfaces.AllChildrenAreOfType; /** * A block of code. This is a {@linkplain ASTStatement statement} that @@ -19,7 +18,7 @@ import net.sourceforge.pmd.lang.java.ast.InternalInterfaces.AllChildrenAreOfType * */ public final class ASTBlock extends ASTMaybeEmptyListOf - implements ASTSwitchArrowRHS, ASTStatement, AllChildrenAreOfType { + implements ASTSwitchArrowRHS, ASTStatement { ASTBlock(int id) { super(id, ASTStatement.class); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java index e0cf7e923c..694ae630fb 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java @@ -9,7 +9,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; /** * The boolean literal, either "true" or "false". */ -public final class ASTBooleanLiteral extends AbstractLiteral implements ASTLiteral { +public final class ASTBooleanLiteral extends AbstractLiteral { private boolean isTrue; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCastExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCastExpression.java index 1c4ccf07e6..7ce73d5857 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCastExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCastExpression.java @@ -14,7 +14,7 @@ package net.sourceforge.pmd.lang.java.ast; * * */ -public final class ASTCastExpression extends AbstractJavaExpr implements ASTExpression { +public final class ASTCastExpression extends AbstractJavaExpr { ASTCastExpression(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java index c089ccabc0..5cc8e60b6f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java @@ -15,7 +15,7 @@ import net.sourceforge.pmd.lang.document.Chars; * retrieve the actual runtime value. Use {@link #getLiteralText()} to * retrieve the text. */ -public final class ASTCharLiteral extends AbstractLiteral implements ASTLiteral { +public final class ASTCharLiteral extends AbstractLiteral { ASTCharLiteral(int id) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java index f6861c8bb7..f9afd45f6e 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java @@ -13,7 +13,6 @@ import net.sourceforge.pmd.annotation.Experimental; import net.sourceforge.pmd.lang.ast.AstInfo; import net.sourceforge.pmd.lang.ast.NodeStream; import net.sourceforge.pmd.lang.ast.RootNode; -import net.sourceforge.pmd.lang.ast.impl.GenericNode; import net.sourceforge.pmd.lang.java.symbols.table.JSymbolTable; import net.sourceforge.pmd.lang.java.types.TypeSystem; import net.sourceforge.pmd.lang.java.types.ast.internal.LazyTypeResolver; @@ -49,7 +48,7 @@ import net.sourceforge.pmd.lang.rule.xpath.NoAttribute; * @see JEP 445: Unnamed Classes and Instance Main Methods (Preview) (Java 21) * @see #isUnnamedClass() */ -public final class ASTCompilationUnit extends AbstractJavaNode implements JavaNode, GenericNode, RootNode { +public final class ASTCompilationUnit extends AbstractJavaNode implements RootNode { private LazyTypeResolver lazyTypeResolver; private List comments; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConstructorCall.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConstructorCall.java index 3258603e23..c70ac0f292 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConstructorCall.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConstructorCall.java @@ -22,11 +22,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * * */ -public final class ASTConstructorCall extends AbstractInvocationExpr - implements ASTPrimaryExpression, - QualifiableExpression, - LeftRecursiveNode, - InvocationNode { +public final class ASTConstructorCall extends AbstractInvocationExpr implements QualifiableExpression, LeftRecursiveNode { ASTConstructorCall(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java index 3c7d03baf3..4832a5d799 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java @@ -19,9 +19,8 @@ import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; * */ public final class ASTEnumConstant extends AbstractJavaTypeNode - implements Annotatable, - InvocationNode, - ModifierOwner, + implements InvocationNode, + ModifierOwner, ASTBodyDeclaration, InternalInterfaces.VariableIdOwner, JavadocCommentOwner { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExecutableDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExecutableDeclaration.java index ce1fca46b8..db9f6d5b03 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExecutableDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExecutableDeclaration.java @@ -7,7 +7,6 @@ package net.sourceforge.pmd.lang.java.ast; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.lang.ast.impl.GenericNode; import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol; import net.sourceforge.pmd.lang.java.types.JClassType; import net.sourceforge.pmd.lang.java.types.JMethodSig; @@ -32,7 +31,6 @@ public interface ASTExecutableDeclaration extends ModifierOwner, ASTBodyDeclaration, TypeParamOwnerNode, - GenericNode, JavadocCommentOwner { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java index 53fe256d36..3dcea35dd8 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java @@ -39,11 +39,7 @@ import net.sourceforge.pmd.lang.java.types.ast.ExprContext; * * */ -public interface ASTExpression - extends JavaNode, - TypeNode, - ASTMemberValue, - ASTSwitchArrowRHS { +public interface ASTExpression extends TypeNode, ASTMemberValue, ASTSwitchArrowRHS { /** * Always returns true. This is to allow XPath queries diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java index fead94268a..e3ba01bc4a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java @@ -22,9 +22,7 @@ import net.sourceforge.pmd.lang.rule.xpath.DeprecatedAttribute; * */ public final class ASTFieldDeclaration extends AbstractJavaNode - implements Iterable, - LeftRecursiveNode, - ModifierOwner, + implements LeftRecursiveNode, ASTBodyDeclaration, InternalInterfaces.MultiVariableIdOwner, JavadocCommentOwner { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java index e889684245..1151c12662 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java @@ -25,10 +25,7 @@ import net.sourceforge.pmd.lang.java.types.TypingContext; * */ public final class ASTFormalParameter extends AbstractJavaNode - implements ModifierOwner, - TypeNode, - Annotatable, - VariableIdOwner { + implements ModifierOwner, TypeNode, VariableIdOwner { ASTFormalParameter(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java index 10c06d0a15..6e6857fcd1 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java @@ -25,9 +25,7 @@ import net.sourceforge.pmd.lang.document.FileLocation; */ // TODO extend AbstractStatement public final class ASTLocalVariableDeclaration extends AbstractJavaNode - implements Iterable, - ASTStatement, - ModifierOwner, + implements ASTStatement, LeftRecursiveNode, // ModifierList is parsed separately in BlockStatement InternalInterfaces.MultiVariableIdOwner { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java index abde828d20..3ddb812b9f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java @@ -19,11 +19,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * * */ -public final class ASTMethodCall extends AbstractInvocationExpr - implements ASTPrimaryExpression, - QualifiableExpression, - InvocationNode, - MethodUsage { +public final class ASTMethodCall extends AbstractInvocationExpr implements QualifiableExpression { ASTMethodCall(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodReference.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodReference.java index 84152c4bb9..7106468563 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodReference.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodReference.java @@ -23,8 +23,7 @@ import net.sourceforge.pmd.lang.java.types.TypeSystem; * */ public final class ASTMethodReference extends AbstractJavaExpr - implements ASTPrimaryExpression, - QualifiableExpression, + implements QualifiableExpression, LeftRecursiveNode, MethodUsage, FunctionalExpression { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java index 58180fbad3..05a1cb1b24 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java @@ -15,7 +15,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * * */ -public final class ASTNullLiteral extends AbstractLiteral implements ASTLiteral { +public final class ASTNullLiteral extends AbstractLiteral { ASTNullLiteral(int id) { super(id); } diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java index 95c4bf5c87..b31b8ec29a 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java @@ -14,7 +14,7 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType; /** * A numeric literal of any type (double, int, long, float, etc). */ -public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiteral { +public final class ASTNumericLiteral extends AbstractLiteral { /** * True if this is an integral literal, ie int OR long, diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.java index 082a3e55e7..0ed93007be 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.ast; import net.sourceforge.pmd.lang.java.ast.ASTList.ASTMaybeEmptyListOf; -import net.sourceforge.pmd.lang.java.ast.InternalInterfaces.AllChildrenAreOfType; import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol; /** @@ -18,8 +17,7 @@ import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol; * * */ -public final class ASTRecordComponentList extends ASTMaybeEmptyListOf - implements SymbolDeclaratorNode, AllChildrenAreOfType { +public final class ASTRecordComponentList extends ASTMaybeEmptyListOf implements SymbolDeclaratorNode { private JConstructorSymbol symbol; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java index 5612c7a4bc..928138bb5f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java @@ -18,7 +18,7 @@ import net.sourceforge.pmd.util.StringUtil; * in the source ({@link #getLiteralText()}). {@link #getConstValue()} allows to recover * the actual runtime value, by processing escapes. */ -public final class ASTStringLiteral extends AbstractLiteral implements ASTLiteral { +public final class ASTStringLiteral extends AbstractLiteral { private static final String TEXTBLOCK_DELIMITER = "\"\"\""; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java index 42b34f67c8..c25ded1073 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java @@ -18,9 +18,7 @@ import net.sourceforge.pmd.lang.ast.NodeStream; * *

Their syntax is identical though, and described on {@link ASTSwitchLike}. */ -public final class ASTSwitchExpression extends AbstractJavaExpr - implements ASTExpression, - ASTSwitchLike { +public final class ASTSwitchExpression extends AbstractJavaExpr implements ASTSwitchLike { ASTSwitchExpression(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java index 88f97fecfe..73a74cfb19 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java @@ -43,7 +43,7 @@ import net.sourceforge.pmd.lang.java.types.JTypeMirror; *

Note: This node has been called ASTVariableDeclaratorId in PMD 6. */ // @formatter:on -public final class ASTVariableId extends AbstractTypedSymbolDeclarator implements ModifierOwner, SymbolDeclaratorNode { +public final class ASTVariableId extends AbstractTypedSymbolDeclarator implements ModifierOwner { private String name; private List usages = Collections.emptyList(); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractTypeBodyDeclaration.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractTypeBodyDeclaration.java index 342b6ae70a..c916eb2780 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractTypeBodyDeclaration.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractTypeBodyDeclaration.java @@ -8,7 +8,7 @@ package net.sourceforge.pmd.lang.java.ast; * @author Clรฉment Fournier * @since 6.2.0 */ -abstract class AbstractTypeBodyDeclaration extends AbstractJavaNode implements JavaNode { +abstract class AbstractTypeBodyDeclaration extends AbstractJavaNode { AbstractTypeBodyDeclaration(int id) { super(id); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalInterfaces.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalInterfaces.java index 208d8f2538..874b310a39 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalInterfaces.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalInterfaces.java @@ -134,7 +134,7 @@ final class InternalInterfaces { ASTVariableId getVarId(); } - interface MultiVariableIdOwner extends JavaNode, Iterable, ModifierOwner { + interface MultiVariableIdOwner extends Iterable, ModifierOwner { /** * Returns a stream of the variable ids declared diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JAccessibleElementSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JAccessibleElementSymbol.java index 956c2fd1ef..37be4bd6d6 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JAccessibleElementSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JAccessibleElementSymbol.java @@ -16,7 +16,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; * * @since 7.0.0 */ -public interface JAccessibleElementSymbol extends JElementSymbol, AnnotableSymbol { +public interface JAccessibleElementSymbol extends AnnotableSymbol { /** * Conventional return value of {@link #getPackageName()} for diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JExecutableSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JExecutableSymbol.java index 076db24b92..c8bbac2c0f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JExecutableSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JExecutableSymbol.java @@ -19,7 +19,7 @@ import net.sourceforge.pmd.lang.java.types.Substitution; * Common supertype for {@linkplain JMethodSymbol method} * and {@linkplain JConstructorSymbol constructor symbols}. */ -public interface JExecutableSymbol extends JAccessibleElementSymbol, JTypeParameterOwnerSymbol { +public interface JExecutableSymbol extends JTypeParameterOwnerSymbol { /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java index fbe2aee615..638bcbee7d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java @@ -21,7 +21,7 @@ import net.sourceforge.pmd.lang.java.types.JTypeMirror; * * @since 7.0.0 */ -public interface JTypeDeclSymbol extends JElementSymbol, JAccessibleElementSymbol { +public interface JTypeDeclSymbol extends JAccessibleElementSymbol { /** * Returns true if this class is a symbolic reference to an unresolved diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java index 1d575cd9d5..c8b8c6da48 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java @@ -16,12 +16,11 @@ import net.sourceforge.pmd.lang.java.ast.ASTFieldDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration; import net.sourceforge.pmd.lang.java.ast.ASTVariableId; import net.sourceforge.pmd.lang.java.ast.JModifier; -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol; import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol; import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol; -class AstUnnamedClassSym extends EmptyClassSymbol implements JClassSymbol { +class AstUnnamedClassSym extends EmptyClassSymbol { private final List declaredMethods; private final List declaredFields; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java index dd2647ec6e..107f81cc53 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java @@ -10,13 +10,12 @@ import java.lang.reflect.Modifier; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; -import net.sourceforge.pmd.lang.java.symbols.JClassSymbol; import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol; import net.sourceforge.pmd.lang.java.symbols.internal.SymbolEquality; import net.sourceforge.pmd.lang.java.symbols.internal.SymbolToStrings; import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind; -abstract class BasePrimitiveSymbol extends EmptyClassSymbol implements JClassSymbol { +abstract class BasePrimitiveSymbol extends EmptyClassSymbol { BasePrimitiveSymbol(TypeSystem ts) { super(() -> ts); diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeVar.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeVar.java index 8d3182bb09..432e917c29 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeVar.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeVar.java @@ -36,7 +36,7 @@ import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot; *

Type variables do not, in general, use reference identity. Use * equals to compare them. */ -public interface JTypeVar extends JTypeMirror, SubstVar { +public interface JTypeVar extends SubstVar { /** diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java index c36c10a74e..cf5a71ea5c 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java @@ -35,7 +35,7 @@ import net.sourceforge.pmd.lang.java.types.TypeSystem; * type is of no importance outside the implementation of this framework. */ @SuppressWarnings("PMD.CompareObjectsWithEquals") -public final class InferenceVar implements JTypeMirror, SubstVar { +public final class InferenceVar implements SubstVar { // we used to use greek letters (for style), but they're hard to type private static final String NAMES = "abcdefghijklmnopqrstuvwxyz"; // + "ฮฑฮฒฮณฮดฮตฮถฮทฮธฮบฮปฮผฮฝฮพฯ€ฯฯ‚ฯ…ฯ†ฯ‡ฯˆฯ‰" diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/MethodInvocMirror.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/MethodInvocMirror.java index f42f61f1bd..fd66d5116f 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/MethodInvocMirror.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/MethodInvocMirror.java @@ -21,10 +21,9 @@ import net.sourceforge.pmd.lang.java.types.TypeConversion; import net.sourceforge.pmd.lang.java.types.TypeOps; import net.sourceforge.pmd.lang.java.types.internal.InternalMethodTypeItf; import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror; -import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.InvocationMirror; import net.sourceforge.pmd.lang.java.types.internal.infer.ast.JavaExprMirrors.MirrorMaker; -class MethodInvocMirror extends BaseInvocMirror implements InvocationMirror { +class MethodInvocMirror extends BaseInvocMirror { MethodInvocMirror(JavaExprMirrors mirrors, ASTMethodCall call, @Nullable ExprMirror parent, MirrorMaker subexprMaker) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/StandaloneExprMirror.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/StandaloneExprMirror.java index bee13975a6..79abd11b51 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/StandaloneExprMirror.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/StandaloneExprMirror.java @@ -10,7 +10,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTExpression; import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror; -class StandaloneExprMirror extends BaseExprMirror implements ExprMirror { +class StandaloneExprMirror extends BaseExprMirror { StandaloneExprMirror(JavaExprMirrors factory, ASTExpression myNode, @Nullable ExprMirror parent) { super(factory, myNode, parent); From 798b2c31a1330f80492f9f76d8c1a3692d0c6652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 15:29:17 +0200 Subject: [PATCH 075/121] Fix FN --- .../types/ast/internal/PolyResolution.java | 5 ++++ .../java/types/ast/ConversionContextTests.kt | 27 ++++++++++++++++++- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 24 +++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index e6ac760193..b69c2b05c2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -434,6 +434,11 @@ public final class PolyResolution { return ExprContext.getMissingInstance(); } + if (!internalUse) { + // Only in type resolution do we need to fetch the outermost context + return newInvocContext(papi, node.getIndexInParent()); + } + // Constructor or method call, maybe there's another context around // We want to fetch the outermost invocation node, but not further ExprContext outerCtx = contextOf(papi, /*onlyInvoc:*/true, internalUse); diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 1a67878e70..3b260582f2 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -10,7 +10,6 @@ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils import net.sourceforge.pmd.lang.java.types.STRING -import net.sourceforge.pmd.lang.java.types.TypeTestUtil import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.ASSIGNMENT import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.INVOCATION import net.sourceforge.pmd.lang.java.types.parseWithTypeInferenceSpy @@ -303,4 +302,30 @@ class ConversionContextTests : ProcessorTestSpec({ lambda.conversionContext::getKind shouldBe INVOCATION } } + + parserTest("Ctx of nested invocation") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + class Foo { + int eatByte(byte b) {} + int eatInt(int b) {} + + void eq(Object val) { + Bar b = (Bar) val; + eatByte(b.x); + eatInt(eatByte(b.x)); + } + class Bar { byte x; } + } + """) + + val (nonNested, nested) = acu.descendants(ASTFieldAccess::class.java).toList() + + spy.shouldBeOk { + nested.conversionContext.targetType shouldBe byte // not int + nonNested.conversionContext.targetType shouldBe byte + nested.conversionContext.kind shouldBe INVOCATION + nonNested.conversionContext.kind shouldBe INVOCATION + } + } }) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 692e80118c..6ae2b0bab5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -440,4 +440,28 @@ public class Foo { } ]]> + + Unboxing of byte in invocation ctx + 2 + 10,11 + + Unnecessary explicit unboxing + Unnecessary explicit unboxing + + + From bd24b185ea296f0c7a7b75b9bb38aa303f47d9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 15:44:46 +0200 Subject: [PATCH 076/121] Fix another FN with numeric contexts --- .../types/ast/internal/PolyResolution.java | 9 +++++++-- .../java/types/ast/ConversionContextTests.kt | 19 ++++++++++++++++--- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index b69c2b05c2..1e306d8d1d 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -573,8 +573,13 @@ public final class PolyResolution { : newNumericContext(nodeType.unbox()); case EQ: case NE: - if (otherType.isPrimitive() != nodeType.isPrimitive()) { - return newNonPolyContext(otherType.unbox()); + if (otherType.isNumeric() || nodeType.isNumeric()) { + JTypeMirror prom = TypeConversion.binaryNumericPromotion(otherType.unbox(), nodeType.unbox()); + if (prom == ts.ERROR) { + // cannot be promoted + return ExprContext.getMissingInstance(); + } + return newNumericContext(prom); } return ExprContext.getMissingInstance(); case ADD: diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 3b260582f2..8217038a0f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -10,8 +10,7 @@ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils import net.sourceforge.pmd.lang.java.types.STRING -import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.ASSIGNMENT -import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.INVOCATION +import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.* import net.sourceforge.pmd.lang.java.types.parseWithTypeInferenceSpy import net.sourceforge.pmd.lang.java.types.shouldHaveType import net.sourceforge.pmd.lang.test.ast.component6 @@ -198,14 +197,17 @@ class ConversionContextTests : ProcessorTestSpec({ eat(i << j); eat(i & j); + eatbool(i == (Integer) j); + eat(i + e); eat(i * e); } void eat(double d) {} + void eatbool(boolean d) {} } """) - val (mulint, lshift, and, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() + val (mulint, lshift, and, cmp, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() spy.shouldBeOk { listOf(mulint, lshift, and).forEach { @@ -214,6 +216,17 @@ class ConversionContextTests : ProcessorTestSpec({ it.rightOperand.conversionContext::getTargetType shouldBe ts.INT } } + withClue(cmp) { + cmp.conversionContext::getTargetType shouldBe boolean + cmp.conversionContext::getKind shouldBe INVOCATION + + listOf(cmp.leftOperand, cmp.rightOperand).forEach { + withClue(it) { + it.conversionContext::getTargetType shouldBe int + it.conversionContext::getKind shouldBe NUMERIC + } + } + } listOf(plusdouble, muldouble).forEach { withClue(it) { it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 6ae2b0bab5..a5dc039df9 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -464,4 +464,22 @@ public class Foo { } ]]> + + Unboxing of byte in numeric ctx + 1 + + Unnecessary explicit unboxing + + + From b640194f769e10362627826ffa097041b1fc93ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 16:31:11 +0200 Subject: [PATCH 077/121] Fix FN with ternary --- .../rule/codestyle/UnnecessaryBoxingRule.java | 15 +- .../types/ast/internal/PolyResolution.java | 18 +++ .../java/types/ast/ConversionContextTests.kt | 147 +++++++++++------- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 30 ++++ 4 files changed, 155 insertions(+), 55 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 603854b411..d30e65c8b7 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -24,6 +24,7 @@ import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; import net.sourceforge.pmd.lang.java.types.TypePrettyPrint; import net.sourceforge.pmd.lang.java.types.TypeTestUtil; import net.sourceforge.pmd.lang.java.types.ast.ExprContext; +import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind; import net.sourceforge.pmd.reporting.RuleContext; /** @@ -150,9 +151,9 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { if (sourceType.equals(conversionOutput)) { reason = "boxing of boxed value"; } else if (ctxType != null) { - JTypeMirror conv = implicitConversionResult(sourceType, ctxType); + JTypeMirror conv = implicitConversionResult(sourceType, ctxType, ctx.getKind()); if (conv != null - && conv.equals(implicitConversionResult(conversionOutput, ctxType)) + && conv.equals(implicitConversionResult(conversionOutput, ctxType, ctx.getKind())) && conversionDoesNotChangesValue(sourceType, conversionOutput)) { if (sourceType.unbox().equals(conversionOutput)) { reason = "explicit unboxing"; @@ -219,7 +220,15 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { * Type of the converted i in context ctx. If no implicit * conversion is possible then return null. */ - private static @Nullable JTypeMirror implicitConversionResult(JTypeMirror i, JTypeMirror ctx) { + private static @Nullable JTypeMirror implicitConversionResult(JTypeMirror i, JTypeMirror ctx, ExprContextKind kind) { + if (kind == ExprContextKind.CAST) { + // in cast contexts conversions are less restrictive + if (!ctx.isPrimitive()) { + return i.box(); + } else { + return i.unbox(); + } + } if (!ctx.isPrimitive()) { // boxing return i.box().isSubtypeOf(ctx) ? i.box() : null; diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index 1e306d8d1d..084098baa0 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -43,6 +43,7 @@ import net.sourceforge.pmd.lang.java.ast.ASTSwitchExpression; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLabel; import net.sourceforge.pmd.lang.java.ast.ASTSwitchLike; import net.sourceforge.pmd.lang.java.ast.ASTType; +import net.sourceforge.pmd.lang.java.ast.ASTUnaryExpression; import net.sourceforge.pmd.lang.java.ast.ASTVariableDeclarator; import net.sourceforge.pmd.lang.java.ast.ASTVoidType; import net.sourceforge.pmd.lang.java.ast.ASTYieldStatement; @@ -601,6 +602,23 @@ public final class PolyResolution { default: return ExprContext.getMissingInstance(); } + } else if (papa instanceof ASTUnaryExpression) { + switch (((ASTUnaryExpression) papa).getOperator()) { + case UNARY_PLUS: + case UNARY_MINUS: + case COMPLEMENT: + JTypeMirror parentType = ((ASTUnaryExpression) papa).getTypeMirror(); + if (parentType == ts.ERROR) { + break; + } + // this was already unary promoted + return newNumericContext(parentType); + case NEGATION: + return booleanCtx; + default: + break; + } + return ExprContext.getMissingInstance(); } else { return ExprContext.getMissingInstance(); } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 8217038a0f..3332d10ff1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -6,18 +6,32 @@ package net.sourceforge.pmd.lang.java.types.ast import io.kotest.assertions.withClue +import io.kotest.matchers.Matcher +import io.kotest.matchers.MatcherResult +import io.kotest.matchers.should import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils -import net.sourceforge.pmd.lang.java.types.STRING +import net.sourceforge.pmd.lang.java.types.* +import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind import net.sourceforge.pmd.lang.java.types.ast.ExprContext.ExprContextKind.* -import net.sourceforge.pmd.lang.java.types.parseWithTypeInferenceSpy -import net.sourceforge.pmd.lang.java.types.shouldHaveType -import net.sourceforge.pmd.lang.test.ast.component6 +import net.sourceforge.pmd.lang.test.ast.* import net.sourceforge.pmd.lang.test.ast.shouldBe class ConversionContextTests : ProcessorTestSpec({ + fun haveContext(kind: ExprContextKind, target: JTypeMirror?): Matcher = Matcher { + val ctx = it.conversionContext + MatcherResult( + passed = ctx.targetType == target && ctx.kind == kind, + failureMessageFn = { "Expected $kind (target $target), but got ${ctx.kind} (target ${ctx.targetType})" }, + negatedFailureMessageFn = { "Expected not $kind (target $target), but got ${ctx.kind} (target ${ctx.targetType})" }, + ) + } + + fun TypeDslMixin.haveBooleanContext(): Matcher = haveContext(BOOLEAN, boolean) + fun haveNoContext(): Matcher = haveContext(MISSING, null) + parserTest("Test simple contexts") { val (acu, spy) = parser.parseWithTypeInferenceSpy(""" @@ -32,10 +46,10 @@ class ConversionContextTests : ProcessorTestSpec({ val (valueOf, _, doubleCast, doubleLit, intLit) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { - valueOf.conversionContext::isMissing shouldBe true - doubleCast.conversionContext::getTargetType shouldBe ts.OBJECT - doubleLit.conversionContext::getTargetType shouldBe double.box() - intLit.conversionContext::getTargetType shouldBe double + valueOf should haveNoContext() + doubleCast should haveContext(INVOCATION, ts.OBJECT) + doubleLit should haveContext(CAST, double.box()) + intLit should haveContext(ASSIGNMENT, double) } } @@ -50,12 +64,11 @@ class ConversionContextTests : ProcessorTestSpec({ } """) - val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, num1, shortCast, num5) = acu.descendants(ASTExpression::class.java).toList() spy.shouldBeOk { // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe false - ternary.conversionContext::getTargetType shouldBe double + ternary should haveContext(ASSIGNMENT, double) // but it has type int ternary shouldHaveType int @@ -65,8 +78,9 @@ class ConversionContextTests : ProcessorTestSpec({ num1 shouldHaveType int shortCast shouldHaveType short - num1.conversionContext::getTargetType shouldBe int - shortCast.conversionContext::getTargetType shouldBe int + num1 should haveContext(TERNARY, int) + shortCast should haveContext(TERNARY, int) + num5 should haveContext(CAST, short) } } @@ -85,8 +99,7 @@ class ConversionContextTests : ProcessorTestSpec({ spy.shouldBeOk { // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe true - ternary.conversionContext::getTargetType shouldBe null + ternary should haveNoContext() // but it has type int ternary shouldHaveType int @@ -96,8 +109,8 @@ class ConversionContextTests : ProcessorTestSpec({ integerCast shouldHaveType int.box() num4 shouldHaveType int - integerCast.conversionContext::getTargetType shouldBe int - num4.conversionContext::getTargetType shouldBe int + integerCast should haveContext(TERNARY, int) + num4 should haveContext(TERNARY, int) } } parserTest("Test context of assert stmt") { @@ -114,9 +127,9 @@ class ConversionContextTests : ProcessorTestSpec({ val (boxedBool, bool, str) = acu.descendants(ASTVariableAccess::class.java).toList() spy.shouldBeOk { - boxedBool.conversionContext::getTargetType shouldBe ts.BOOLEAN - bool.conversionContext::getTargetType shouldBe ts.BOOLEAN - str.conversionContext::getTargetType shouldBe ts.STRING + boxedBool should haveBooleanContext() + bool should haveBooleanContext() + str should haveContext(STRING, ts.STRING) } } @@ -139,13 +152,13 @@ class ConversionContextTests : ProcessorTestSpec({ spy.shouldBeOk { - ifstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - whilestmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - forstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - dostmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + ifstmt should haveBooleanContext() + whilestmt should haveBooleanContext() + forstmt should haveBooleanContext() + dostmt should haveBooleanContext() - forUpdate.conversionContext::getTargetType shouldBe null - foreachstmt.conversionContext::getTargetType shouldBe null + forUpdate should haveNoContext() + foreachstmt should haveNoContext() } } @@ -163,8 +176,8 @@ class ConversionContextTests : ProcessorTestSpec({ val (booleanCast, objectCast) = acu.descendants(ASTCastExpression::class.java).toList() spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe null - objectCast.conversionContext::getTargetType shouldBe null + booleanCast should haveNoContext() + objectCast should haveNoContext() } } @@ -181,7 +194,7 @@ class ConversionContextTests : ProcessorTestSpec({ val (booleanCast) = acu.descendants(ASTCastExpression::class.java).toList() spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe boolean + booleanCast should haveBooleanContext() } } @@ -212,25 +225,23 @@ class ConversionContextTests : ProcessorTestSpec({ spy.shouldBeOk { listOf(mulint, lshift, and).forEach { withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.INT - it.rightOperand.conversionContext::getTargetType shouldBe ts.INT + it.leftOperand should haveContext(NUMERIC, int) + it.rightOperand should haveContext(NUMERIC, int) } } withClue(cmp) { - cmp.conversionContext::getTargetType shouldBe boolean - cmp.conversionContext::getKind shouldBe INVOCATION + cmp should haveContext(INVOCATION, boolean) listOf(cmp.leftOperand, cmp.rightOperand).forEach { withClue(it) { - it.conversionContext::getTargetType shouldBe int - it.conversionContext::getKind shouldBe NUMERIC + it should haveContext(NUMERIC, int) } } } listOf(plusdouble, muldouble).forEach { withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE - it.rightOperand.conversionContext::getTargetType shouldBe ts.DOUBLE + it.leftOperand should haveContext(NUMERIC, double) + it.rightOperand should haveContext(NUMERIC, double) } } } @@ -255,8 +266,8 @@ class ConversionContextTests : ProcessorTestSpec({ concats.forEach { withClue(it) { JavaAstUtils.isStringConcatExpr(it) shouldBe true - it.leftOperand.conversionContext::getTargetType shouldBe ts.STRING - it.rightOperand.conversionContext::getTargetType shouldBe ts.STRING + it.leftOperand should haveContext(STRING, ts.STRING) + it.rightOperand should haveContext(STRING, ts.STRING) } } } @@ -276,11 +287,11 @@ class ConversionContextTests : ProcessorTestSpec({ val (l0, l1) = acu.descendants(ASTInfixExpression::class.java).toList() spy.shouldBeOk { - l0.leftOperand.conversionContext::getTargetType shouldBe int - l0.rightOperand.conversionContext::getTargetType shouldBe int + l0.leftOperand should haveContext(NUMERIC, int) + l0.rightOperand should haveContext(NUMERIC, int) - l1.leftOperand.conversionContext::getTargetType shouldBe long - l1.rightOperand.conversionContext::getTargetType shouldBe long + l1.leftOperand should haveContext(NUMERIC, long) + l1.rightOperand should haveContext(NUMERIC, long) } } @@ -307,12 +318,10 @@ class ConversionContextTests : ProcessorTestSpec({ val (lambda, lambdaToLong) = acu.descendants(ASTLambdaExpression::class.java).toList() spy.shouldBeOk { - lambda.expressionBody!!.conversionContext shouldBe ExprContext.getMissingInstance() - - lambdaToLong.expressionBody!!.conversionContext::getTargetType shouldBe long - lambdaToLong.expressionBody!!.conversionContext::getKind shouldBe ASSIGNMENT - + lambda.expressionBody!! should haveNoContext() lambda.conversionContext::getKind shouldBe INVOCATION + + lambdaToLong.expressionBody!! should haveContext(ASSIGNMENT, long) } } @@ -335,10 +344,44 @@ class ConversionContextTests : ProcessorTestSpec({ val (nonNested, nested) = acu.descendants(ASTFieldAccess::class.java).toList() spy.shouldBeOk { - nested.conversionContext.targetType shouldBe byte // not int - nonNested.conversionContext.targetType shouldBe byte - nested.conversionContext.kind shouldBe INVOCATION - nonNested.conversionContext.kind shouldBe INVOCATION + nested should haveContext(INVOCATION, byte) // not int + nonNested should haveContext(INVOCATION, byte) + } + } + + parserTest("Context of unary exprs") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + void eq(boolean b, short s, int i, double d) { + eat(!a); + eat(~s); + eat(+s); eat(+i); eat(+d); + eat(-s); eat(-i); eat(-d); + i++; + --d; + } + void eat(Object o) {} + } + """ + ) + + val (not, complement, plusShort, plusInt, plusDouble, + minusShort, minusInt, minusDouble, iplusplus, minusminusd) = acu.descendants(ASTUnaryExpression::class.java) + .toList { it.operand } + + spy.shouldBeOk { + not should haveBooleanContext() + complement should haveContext(NUMERIC, int) + plusShort should haveContext(NUMERIC, int) + plusInt should haveContext(NUMERIC, int) + plusDouble should haveContext(NUMERIC, double) + minusShort should haveContext(NUMERIC, int) + minusInt should haveContext(NUMERIC, int) + minusDouble should haveContext(NUMERIC, double) + iplusplus should haveNoContext() + minusminusd should haveNoContext() } } }) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index a5dc039df9..648e98a657 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -482,4 +482,34 @@ public class Foo { } ]]> + + Boxing of bool under cast + 1 + + Unnecessary explicit boxing + + T cast(boolean b) { + return (T) Boolean.valueOf(b); + } + } + ]]> + + + Unboxing of bool under neg + 1 + + Unnecessary explicit unboxing + + + From 419ff13fe7050a829252f20f36130e55496bb57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 18:02:26 +0200 Subject: [PATCH 078/121] Add new tests --- .../rule/codestyle/UnnecessaryBoxingRule.java | 22 +++++++----- .../rule/codestyle/xml/UnnecessaryBoxing.xml | 36 +++++++++++++++++++ .../rule/codestyle/xml/UnnecessaryCast.xml | 21 +++++++++++ 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index d30e65c8b7..2444c64ac4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -222,22 +222,26 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { */ private static @Nullable JTypeMirror implicitConversionResult(JTypeMirror i, JTypeMirror ctx, ExprContextKind kind) { if (kind == ExprContextKind.CAST) { - // in cast contexts conversions are less restrictive - if (!ctx.isPrimitive()) { - return i.box(); - } else { - return i.unbox(); + // In cast contexts conversions are less restrictive. + if (i.isPrimitive() != ctx.isPrimitive()) { + // Whether an unboxing or boxing conversion may occur depends on whether + // the expression has a primitive type or not (not on the cast type). + // https://docs.oracle.com/javase/specs/jls/se22/html/jls-5.html#jls-5.5 + return i.isPrimitive() ? i.box() : i.unbox(); + } else if (i.isNumeric() && ctx.isNumeric()) { + // then narrowing or widening conversions occur to transform i to ctx + return ctx; } + // otherwise no conversion occurs + return i; } if (!ctx.isPrimitive()) { // boxing return i.box().isSubtypeOf(ctx) ? i.box() : null; - } else if (i.isBoxedPrimitive() && ctx.isPrimitive()) { - // Integer x = 1; - // long l = x; + } else if (i.isBoxedPrimitive()) { // unboxing then optional widening return i.unbox().isSubtypeOf(ctx) ? ctx : null; - } else if (i.isPrimitive() && ctx.isPrimitive()) { + } else if (i.isPrimitive()) { // widening return i.isSubtypeOf(ctx) ? ctx : null; } diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 648e98a657..32e04a2843 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -512,4 +512,40 @@ public class Foo { } ]]> + + Boxing in ternary + 1 + 7 + + Unnecessary explicit boxing + + + + + Unboxing of Character + 0 + + diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml index 2bad52bdf3..ebac87a9f5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml @@ -845,4 +845,25 @@ class MyClass { } ]]> + + Boxing in ternary + 0 + + From e11376f1efa3e60a7a4d848fa610745e30e5c2eb Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Wed, 15 May 2024 11:31:09 -0400 Subject: [PATCH 079/121] Fix AvoidUsingOctalValue false-positive --- .../pmd/lang/java/ast/ASTNumericLiteral.java | 10 ++--- .../xml/UseUnderscoresInNumericLiterals.xml | 10 +++++ .../errorprone/xml/AvoidUsingOctalValues.xml | 42 +++++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java index 95c4bf5c87..7dc9e1e405 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java @@ -120,10 +120,10 @@ public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiter * for the literal {@code 0} (which can really be any base). */ public int getBase() { - return getBase(getLiteralText()); + return getBase(getLiteralText(), isIntegral()); } - static int getBase(Chars image) { + static int getBase(Chars image, boolean isIntegral) { if (image.length() > 1 && image.charAt(0) == '0') { switch (image.charAt(1)) { case 'x': @@ -132,10 +132,8 @@ public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiter case 'b': case 'B': return 2; - case '.': - return 10; default: - return 8; + return isIntegral ? 8 : 10; } } return 10; @@ -172,7 +170,7 @@ public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiter *

Invalid literals or overflows result in {@code 0L}. */ static long parseIntegralValue(Chars image) { - final int base = getBase(image); + final int base = getBase(image, true); if (base == 8) { image = image.subSequence(1); // 0 } else if (base != 10) { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseUnderscoresInNumericLiterals.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseUnderscoresInNumericLiterals.xml index 9b8b184d0a..1c2939867d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseUnderscoresInNumericLiterals.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UseUnderscoresInNumericLiterals.xml @@ -244,6 +244,16 @@ public class Foo { ]]> + + ok, float literal in hexadecimal and exponent + 0 + + + ok, Lengthy numeric literal with variable name as serialVersionUID 0 diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/AvoidUsingOctalValues.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/AvoidUsingOctalValues.xml index eba4034417..35f61e8098 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/AvoidUsingOctalValues.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/errorprone/xml/AvoidUsingOctalValues.xml @@ -54,6 +54,48 @@ public class Foo { ]]> + + OK, double value + 0 + + + + + OK, double suffix + 0 + + + + + OK, float suffix + 0 + + + + + OK, double value with exponent + 0 + + + bad, 012L 1 From 24c1093bf1fde7fd88e55c610ce2e14c39dbdb10 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 May 2024 08:29:34 +0200 Subject: [PATCH 080/121] [java] Fix test BranchingExprsTestCases - Renamed to BranchingExprsTests so that it is picked up by surefire - Fix cast context --- ...BranchingExprsTestCases.kt => BranchingExprsTests.kt} | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/{BranchingExprsTestCases.kt => BranchingExprsTests.kt} (96%) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt similarity index 96% rename from pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt rename to pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt index 95374c4359..9a0fcf643c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTestCases.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt @@ -13,7 +13,7 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.test.ast.shouldMatchN -class BranchingExprsTestCases : ProcessorTestSpec({ +class BranchingExprsTests : ProcessorTestSpec({ fun TypeSystem.stringSupplier() : JTypeMirror = with (TypeDslOf(this)) { java.util.function.Supplier::class[gen.t_String] @@ -276,7 +276,8 @@ class Scratch { Collection fun(boolean messageSelector) { Collection textFromMessage = - // compile error: a cast doesn't contribute a target type, + // compile error: Inconvertible types; cannot cast 'java.util.Collection' to 'java.util.Collection' + // a cast doesn't contribute a target type, // the ternary is inferred to Collection (Collection) (messageSelector ? emptyList() : emptySet()); @@ -293,8 +294,8 @@ class Scratch { val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() spy.shouldBeOk { - ternary1 shouldHaveType java.util.Collection::class[ts.OBJECT] - ternary2 shouldHaveType java.util.Collection::class[ts.STRING] + ternary1 shouldHaveType gen.t_Collection[captureMatcher(`?`)] // java.util.Collection + ternary2 shouldHaveType gen.`t_Collection{String}` // java.util.Collection } } From f009de5831a30f9bdbd14aaa5675308dfe66eec7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 May 2024 10:06:08 +0200 Subject: [PATCH 081/121] [java] Ensure there is a child test case for ParserTestSpec tests --- .../lang/java/ast/ASTModuleDeclarationTest.kt | 12 +- .../lang/java/ast/ConstValuesKotlinTest.kt | 34 +- .../lang/java/ast/OverrideResolutionTest.kt | 48 +- .../pmd/lang/java/ast/ParserTestSpec.kt | 14 +- .../lang/java/ast/TypeDisambiguationTest.kt | 164 ++--- .../pmd/lang/java/ast/UsageResolutionTest.kt | 50 +- .../table/internal/HeaderScopesTest.kt | 287 +++++---- .../table/internal/LocalTypeScopesTest.kt | 27 +- .../table/internal/MemberInheritanceTest.kt | 140 +++-- .../table/internal/PatternVarScopingTests.kt | 14 +- .../symbols/table/internal/VarScopingTest.kt | 68 ++- .../pmd/lang/java/types/InnerTypesTest.kt | 69 ++- .../pmd/lang/java/types/JMethodSigTest.kt | 44 +- .../pmd/lang/java/types/SamTypesTest.kt | 20 +- .../pmd/lang/java/types/SubstTest.kt | 119 ++-- .../pmd/lang/java/types/TypesFromAstTest.kt | 51 +- .../java/types/ast/ConversionContextTests.kt | 242 ++++---- .../types/internal/infer/AnonCtorsTest.kt | 391 ++++++------ .../internal/infer/BranchingExprsTests.kt | 57 +- .../internal/infer/CaptureInferenceTest.kt | 313 +++++----- .../types/internal/infer/CtorInferenceTest.kt | 249 ++++---- .../types/internal/infer/ExplicitTypesTest.kt | 67 +- .../internal/infer/Java7InferenceTest.kt | 142 ++--- .../internal/infer/LambdaInferenceTest.kt | 577 ++++++++++-------- .../internal/infer/LocalVarInferenceTest.kt | 72 ++- .../internal/infer/MethodRefInferenceTest.kt | 560 +++++++++-------- .../internal/infer/OverloadResolutionTest.kt | 151 ++--- .../internal/infer/OverloadSpecificityTest.kt | 169 ++--- .../types/internal/infer/OverridingTest.kt | 112 ++-- .../internal/infer/PolyResolutionTest.kt | 248 ++++---- .../internal/infer/SpecialMethodsTest.kt | 131 ++-- .../internal/infer/StandaloneTypesTest.kt | 78 +-- .../java/types/internal/infer/StressTest.kt | 33 +- .../infer/TypeAnnotationsInferenceTest.kt | 50 +- .../types/internal/infer/TypeInferenceTest.kt | 155 ++--- .../internal/infer/UncheckedInferenceTest.kt | 161 ++--- .../infer/UnresolvedTypesRecoveryTest.kt | 532 ++++++++-------- .../internal/infer/ast/CtorInvocMirrorTest.kt | 26 +- 38 files changed, 3096 insertions(+), 2581 deletions(-) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt index fdce63d865..02431494de 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt @@ -21,11 +21,13 @@ import net.sourceforge.pmd.lang.java.symbols.JClassSymbol class ASTModuleDeclarationTest : ParserTestSpec({ parserTest("Test annotations on module", javaVersions = since(J9)) { - val root: ASTCompilationUnit = parser.withProcessing(true).parse("@A @a.B module foo { } ") - root.moduleDeclaration.shouldMatchNode { - it.getAnnotation("A") shouldBe annotation("A") - it.getAnnotation("a.B") shouldBe annotation("B") - modName("foo") + doTest { + val root: ASTCompilationUnit = parser.withProcessing(true).parse("@A @a.B module foo { } ") + root.moduleDeclaration.shouldMatchNode { + it.getAnnotation("A") shouldBe annotation("A") + it.getAnnotation("a.B") shouldBe annotation("B") + modName("foo") + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt index 9c2e147443..f55ba94940 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt @@ -7,6 +7,7 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.test.ast.shouldBeA import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol +import net.sourceforge.pmd.lang.java.types.JPrimitiveType /** * @@ -15,25 +16,24 @@ class ConstValuesKotlinTest : ProcessorTestSpec({ parserTest("Test reference cycle doesn't crash resolution") { + doTest { + val acu = parser.parse(""" + class Foo { + static final int I1 = I2; + static final int I2 = I1; + static final int I3 = 0; + } + """.trimIndent()) - val acu = parser.parse(""" - class Foo { - static final int I1 = I2; - static final int I2 = I1; - static final int I3 = 0; + val (i1, i2, i3) = acu.descendants(ASTVariableId::class.java).toList() + + i1.initializer!!.constValue shouldBe null + i2.initializer!!.constValue shouldBe null + i3.initializer!!.constValue shouldBe 0 + + i3.symbol.shouldBeA { + it.constValue shouldBe 0 } - """.trimIndent()) - - val (i1, i2, i3) = acu.descendants(ASTVariableId::class.java).toList() - - - i1.initializer!!.constValue shouldBe null - i2.initializer!!.constValue shouldBe null - i3.initializer!!.constValue shouldBe 0 - - i3.symbol.shouldBeA { - it.constValue shouldBe 0 } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt index 9fe6765fa9..66b8bddc4f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt @@ -8,7 +8,9 @@ import io.kotest.matchers.shouldBe class OverrideResolutionTest : ProcessorTestSpec({ parserTest("Test override resolution prefers superclass method") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ interface Foo { default void foo() {} } interface Bar { default void foo() {} } class Sup { public void foo() {} } @@ -18,16 +20,20 @@ class OverrideResolutionTest : ProcessorTestSpec({ super.foo(); // useless } } - """) - val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - subFoo.overriddenMethod shouldBe supFoo.genericSignature - barFoo.overriddenMethod shouldBe null - fooFoo.overriddenMethod shouldBe null - supFoo.overriddenMethod shouldBe null + """ + ) + val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + subFoo.overriddenMethod shouldBe supFoo.genericSignature + barFoo.overriddenMethod shouldBe null + fooFoo.overriddenMethod shouldBe null + supFoo.overriddenMethod shouldBe null + } } parserTest("Test override resolution without superclass") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ interface Foo { default void foo() {} } interface Bar { default void foo() {} } class Sup implements Bar { public void foo() {} } @@ -37,24 +43,30 @@ class OverrideResolutionTest : ProcessorTestSpec({ super.foo(); // useless } } - """) - val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - supFoo.overriddenMethod shouldBe barFoo.genericSignature - subFoo.overriddenMethod shouldBe fooFoo.genericSignature - barFoo.overriddenMethod shouldBe null - fooFoo.overriddenMethod shouldBe null + """ + ) + val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + supFoo.overriddenMethod shouldBe barFoo.genericSignature + subFoo.overriddenMethod shouldBe fooFoo.genericSignature + barFoo.overriddenMethod shouldBe null + fooFoo.overriddenMethod shouldBe null + } } parserTest("Test override resolution unresolved") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ public class Sub implements Unresolved { @Override public void foo() { } } - """) - val (subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - subFoo.overriddenMethod shouldBe subFoo.typeSystem.UNRESOLVED_METHOD + """ + ) + val (subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + subFoo.overriddenMethod shouldBe subFoo.typeSystem.UNRESOLVED_METHOD + } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt index 7fd12125b3..f3994d2d7b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt @@ -101,7 +101,8 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() * Defines a group of tests that should be named similarly, * executed on several java versions. Calls to "should" in * the block are intercepted to create a new test, with the - * given [name] as a common prefix. + * given [name] as a common prefix. Alternatively you can use + * "doTest" to define a new test case. * * This is useful to make a batch of grammar specs for grammar * regression tests without bothering to find a name. @@ -109,8 +110,9 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() * @param name Name of the container test * @param javaVersions Language versions for which to generate tests * @param spec Assertions. Each call to [io.kotest.matchers.should] on a string - * receiver is replaced by a [GroupTestCtx.should], which creates a - * new parser test. + * receiver is replaced by a [GroupTestCtx.VersionedTestCtx.should], which creates a + * new parser test case. Alternatively use [GroupTestCtx.VersionedTestCtx.doTest] to create + * a new parser test case. */ fun parserTest(name: String, javaVersions: List, @@ -118,6 +120,10 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() parserTestGroup(name) { onVersions(javaVersions) { spec() + + if (!this@onVersions.hasChildren()) { + throw IllegalStateException("versioned parser test '$name' without a test case. Use 'should' or 'doTest'.") + } } } @@ -165,7 +171,7 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() inner class VersionedTestCtx(testScope: TestScope, javaVersion: JavaVersion) : ParserTestCtx(testScope, javaVersion) { - suspend fun doTest(name: String, assertions: suspend VersionedTestCtx.() -> Unit) { + suspend fun doTest(name : String = "[unnamed test case]", assertions: suspend VersionedTestCtx.() -> Unit) { containedParserTestImpl(this@VersionedTestCtx, name, javaVersion = javaVersion) { this@VersionedTestCtx.assertions() } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index fa37adf86c..1f4e24fe27 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt @@ -20,26 +20,30 @@ class TypeDisambiguationTest : ParserTestSpec({ parserTest("Inner class names") { - enableProcessing() + doTest { + enableProcessing() - val acu = parser.parse(""" + val acu = parser.parse( + """ class Foo { Foo.Inner f1; class Inner { } } - """) + """ + ) - val (foo, inner) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.symbol } - val (f1) = acu.descendants(ASTFieldDeclaration::class.java).toList() + val (foo, inner) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.symbol } + val (f1) = acu.descendants(ASTFieldDeclaration::class.java).toList() - f1.typeNode.shouldMatchNode { - it::isFullyQualified shouldBe false - it::getSimpleName shouldBe "Inner" - it::getReferencedSym shouldBe inner - it::getAmbiguousLhs shouldBe null - it::getQualifier shouldBe classType("Foo") { + f1.typeNode.shouldMatchNode { it::isFullyQualified shouldBe false - it::getReferencedSym shouldBe foo + it::getSimpleName shouldBe "Inner" + it::getReferencedSym shouldBe inner + it::getAmbiguousLhs shouldBe null + it::getQualifier shouldBe classType("Foo") { + it::isFullyQualified shouldBe false + it::getReferencedSym shouldBe foo + } } } } @@ -172,9 +176,11 @@ class TypeDisambiguationTest : ParserTestSpec({ } parserTest("Malformed types") { - val logger = enableProcessing() + doTest { + val logger = enableProcessing() - val acu = parser.parse(""" + val acu = parser.parse( + """ package p; class Scratch { static class K {} @@ -199,39 +205,43 @@ class TypeDisambiguationTest : ParserTestSpec({ // Scratch.Inner m; // todo error: Scratch must be parameterized // Scratch.Inner m; // ok, raw type } - """) + """ + ) - val (m0, m1, m2, m3, m4, m5, s0, s1, s2) = + val (m0, m1, m2, m3, m4, m5, s0, s1, s2) = acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() - fun assertErrored(t: ASTClassType, expected: Int, actual: Int) { - val errs = logger.warnings[MALFORMED_GENERIC_TYPE]?.filter { it.first == t } + fun assertErrored(t: ASTClassType, expected: Int, actual: Int) { + val errs = logger.warnings[MALFORMED_GENERIC_TYPE]?.filter { it.first == t } ?: emptyList() - assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") - errs.single().second.toList() shouldBe listOf(expected, actual) + assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") + errs.single().second.toList() shouldBe listOf(expected, actual) + } + + fun assertNoError(t: ASTClassType) { + val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } + assertNull(err, "`${t.text}` should not have produced an error") + } + + assertNoError(m0) + assertErrored(m1, expected = 0, actual = 1) + assertNoError(m2) + assertErrored(m3, expected = 2, actual = 1) + assertErrored(m4, expected = 2, actual = 3) + assertNoError(m5) + + assertNoError(s0) + assertErrored(s1, expected = 1, actual = 2) + assertNoError(s2) } - - fun assertNoError(t: ASTClassType) { - val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } - assertNull(err, "`${t.text}` should not have produced an error") - } - - assertNoError(m0) - assertErrored(m1, expected = 0, actual = 1) - assertNoError(m2) - assertErrored(m3, expected = 2, actual = 1) - assertErrored(m4, expected = 2, actual = 3) - assertNoError(m5) - - assertNoError(s0) - assertErrored(s1, expected = 1, actual = 2) - assertNoError(s2) } parserTest("Unresolved inner types") { - enableProcessing() + doTest { + enableProcessing() - val acu = parser.parse(""" + val acu = parser.parse( + """ package p; import k.OuterUnresolved; @@ -239,35 +249,39 @@ class TypeDisambiguationTest : ParserTestSpec({ class Scratch { OuterUnresolved.InnerUnresolved m0; } - """) + """ + ) - val (m0) = + val (m0) = acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() - val outerUnresolved = m0.qualifier!! - val outerT = outerUnresolved.typeMirror.shouldBeA { - it.symbol.shouldBeA { classSymbol -> - classSymbol::isUnresolved shouldBe true - classSymbol::getSimpleName shouldBe "OuterUnresolved" + val outerUnresolved = m0.qualifier!! + val outerT = outerUnresolved.typeMirror.shouldBeA { + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "OuterUnresolved" + } } - } - val innerT = m0.typeMirror.shouldBeA { - it::getEnclosingType shouldBe outerT - it.symbol.shouldBeA { classSymbol -> - classSymbol::isUnresolved shouldBe true - classSymbol::getSimpleName shouldBe "InnerUnresolved" - classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) + val innerT = m0.typeMirror.shouldBeA { + it::getEnclosingType shouldBe outerT + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "InnerUnresolved" + classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) + } } - } - outerT.symbol.getDeclaredClass("InnerUnresolved").shouldBeSameInstanceAs(innerT.symbol) + outerT.symbol.getDeclaredClass("InnerUnresolved").shouldBeSameInstanceAs(innerT.symbol) + } } parserTest("Invalid annotations") { - val logger = enableProcessing() + doTest { + val logger = enableProcessing() - val acu = parser.parse(""" + val acu = parser.parse( + """ package p; class C { @interface A { } @@ -281,29 +295,31 @@ class TypeDisambiguationTest : ParserTestSpec({ @A int field; } - """) + """ + ) - val (aT, aC, aI, aUnresolved, aOk) = + val (aT, aC, aI, aUnresolved, aOk) = acu.descendants(ASTAnnotation::class.java).map { it.typeNode }.toList() - fun assertErrored(t: ASTClassType) { - val errs = logger.warnings[EXPECTED_ANNOTATION_TYPE]?.filter { it.first == t } + fun assertErrored(t: ASTClassType) { + val errs = logger.warnings[EXPECTED_ANNOTATION_TYPE]?.filter { it.first == t } ?: emptyList() - assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") - errs.single().second.toList() shouldBe emptyList() + assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") + errs.single().second.toList() shouldBe emptyList() + } + + fun assertNoError(t: ASTClassType) { + val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } + assertNull(err, "`${t.text}` should not have produced an error") + } + + assertNoError(aUnresolved) + assertNoError(aOk) + + assertErrored(aT) + assertErrored(aC) + assertErrored(aI) } - - fun assertNoError(t: ASTClassType) { - val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } - assertNull(err, "`${t.text}` should not have produced an error") - } - - assertNoError(aUnresolved) - assertNoError(aOk) - - assertErrored(aT) - assertErrored(aC) - assertErrored(aI) } parserTest("!TODO Import on demand of class defined in same compilation unit that has an extends clause") { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt index 390f485dd3..bee62d6479 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt @@ -17,7 +17,9 @@ import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol class UsageResolutionTest : ProcessorTestSpec({ parserTest("Test usage resolution") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Bar { int f1; { @@ -38,19 +40,23 @@ class UsageResolutionTest : ProcessorTestSpec({ f2 = this.f2; } } - """) - val (barF1, fooF1, fooF2, localF2, localF22) = acu.descendants(ASTVariableId::class.java).toList() - barF1.localUsages.map { it.text.toString() }.shouldContainExactly("this.f1", "super.f1") - fooF1.localUsages.map { it.text.toString() }.shouldContainExactly("f1", "this.f1") - fooF2.localUsages.map { it.text.toString() }.shouldContainExactly("this.f2") - localF2.localUsages.shouldBeEmpty() - localF22.localUsages.shouldBeSingleton { - it.accessType shouldBe WRITE + """ + ) + val (barF1, fooF1, fooF2, localF2, localF22) = acu.descendants(ASTVariableId::class.java).toList() + barF1.localUsages.map { it.text.toString() }.shouldContainExactly("this.f1", "super.f1") + fooF1.localUsages.map { it.text.toString() }.shouldContainExactly("f1", "this.f1") + fooF2.localUsages.map { it.text.toString() }.shouldContainExactly("this.f2") + localF2.localUsages.shouldBeEmpty() + localF22.localUsages.shouldBeSingleton { + it.accessType shouldBe WRITE + } } } parserTest("Test record components") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ record Foo(int p) { Foo { p = 10; @@ -58,20 +64,22 @@ class UsageResolutionTest : ProcessorTestSpec({ void pPlus1() { return p + 1; } } - """) + """ + ) - val (p) = acu.descendants(ASTVariableId::class.java).toList() + val (p) = acu.descendants(ASTVariableId::class.java).toList() - p::isRecordComponent shouldBe true - p.localUsages.shouldHaveSize(2) - p.localUsages[0].shouldBeA { - it.referencedSym!!.shouldBeA { symbol -> - symbol.tryGetNode() shouldBe p + p::isRecordComponent shouldBe true + p.localUsages.shouldHaveSize(2) + p.localUsages[0].shouldBeA { + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p + } } - } - p.localUsages[1].shouldBeA { - it.referencedSym!!.shouldBeA { symbol -> - symbol.tryGetNode() shouldBe p + p.localUsages[1].shouldBeA { + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p + } } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt index b01f0de42a..02b84165d4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt @@ -67,165 +67,193 @@ class HeaderScopesTest : ProcessorTestSpec({ } parserTest("Test same-package scope") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) - val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) - - acu.symbolTable.types().shouldResolveToClass("SomeClassA", "javasymbols.testdata.SomeClassA") + acu.symbolTable.types().shouldResolveToClass("SomeClassA", "javasymbols.testdata.SomeClassA") + } } parserTest("$javalangTypes should be shadowed by $typesInTheSamePackage") { - - val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) + doTest { + val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) - acu.symbolTable.types().typeShadowSequence("Thread") shouldBe - // from same package - listOf(SAME_PACKAGE to "javasymbols.testdata.Thread", - JAVA_LANG to "java.lang.Thread") + acu.symbolTable.types().typeShadowSequence("Thread") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.Thread", + JAVA_LANG to "java.lang.Thread" + ) + } } parserTest("$typesInTheSamePackage should be shadowed by $singleTypeImports") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - - acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe - // from same package - listOf(SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", - SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA") - + acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe + // from same package + listOf( + SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", + SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA" + ) + } } parserTest("$javalangTypes should be shadowed by $singleTypeImports") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - - acu.symbolTable.types().typeShadowSequence("Thread") shouldBe - listOf(SINGLE_IMPORT to "javasymbols.testdata.Thread", - JAVA_LANG to "java.lang.Thread") + acu.symbolTable.types().typeShadowSequence("Thread") shouldBe + listOf( + SINGLE_IMPORT to "javasymbols.testdata.Thread", + JAVA_LANG to "java.lang.Thread" + ) + } } parserTest("$onDemandTypeImports should be shadowed by everything") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.TypeImportsOnDemand::class.java) + // import javasymbols.testdata.*; - val acu = parser.parseClass(javasymbols.testdata.deep.TypeImportsOnDemand::class.java) - // import javasymbols.testdata.*; + val group = acu.symbolTable.types() - val group = acu.symbolTable.types() + group.typeShadowSequence("Thread") shouldBe + // from java.lang + listOf( + JAVA_LANG to "java.lang.Thread", + IMPORT_ON_DEMAND to "javasymbols.testdata.Thread" + ) - group.typeShadowSequence("Thread") shouldBe - // from java.lang - listOf(JAVA_LANG to "java.lang.Thread", - IMPORT_ON_DEMAND to "javasymbols.testdata.Thread") + group.typeShadowSequence("SomeClassA") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", + IMPORT_ON_DEMAND to "javasymbols.testdata.SomeClassA" + ) - group.typeShadowSequence("SomeClassA") shouldBe - // from same package - listOf(SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", - IMPORT_ON_DEMAND to "javasymbols.testdata.SomeClassA") + group.typeShadowSequence("Statics") shouldBe + // from the import-on-demand + listOf(IMPORT_ON_DEMAND to "javasymbols.testdata.Statics") - group.typeShadowSequence("Statics") shouldBe - // from the import-on-demand - listOf(IMPORT_ON_DEMAND to "javasymbols.testdata.Statics") - - group.typeShadowSequence("TestCase1") shouldBe - // from the single type import - listOf(SINGLE_IMPORT to "javasymbols.testdata.TestCase1", - IMPORT_ON_DEMAND to "javasymbols.testdata.TestCase1") + group.typeShadowSequence("TestCase1") shouldBe + // from the single type import + listOf( + SINGLE_IMPORT to "javasymbols.testdata.TestCase1", + IMPORT_ON_DEMAND to "javasymbols.testdata.TestCase1" + ) + } } parserTest("$onDemandStaticImports should import only accessible members") { - - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.let { + acu.symbolTable.let { - it.variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null - it.variables().resolveFirst("PACKAGE_FIELD") shouldBe null - it.variables().resolveFirst("PRIVATE_FIELD") shouldBe null - it.variables().resolveFirst("PROTECTED_FIELD") shouldBe null + it.variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null + it.variables().resolveFirst("PACKAGE_FIELD") shouldBe null + it.variables().resolveFirst("PRIVATE_FIELD") shouldBe null + it.variables().resolveFirst("PROTECTED_FIELD") shouldBe null - it.resolveMethods("packageMethod").shouldHaveSize(0) - it.resolveMethods("privateMethod").shouldHaveSize(0) - it.resolveMethods("protectedMethod").shouldHaveSize(0) - it.resolveMethods("publicMethod").shouldHaveSize(2) - it.resolveMethods("publicMethod2").shouldHaveSize(1) + it.resolveMethods("packageMethod").shouldHaveSize(0) + it.resolveMethods("privateMethod").shouldHaveSize(0) + it.resolveMethods("protectedMethod").shouldHaveSize(0) + it.resolveMethods("publicMethod").shouldHaveSize(2) + it.resolveMethods("publicMethod2").shouldHaveSize(1) - it.types().resolveFirst("PublicStatic") shouldNotBe null - it.types().resolveFirst("PackageStatic") shouldBe null - it.types().resolveFirst("ProtectedStatic") shouldBe null - it.types().resolveFirst("PrivateStatic") shouldBe null + it.types().resolveFirst("PublicStatic") shouldNotBe null + it.types().resolveFirst("PackageStatic") shouldBe null + it.types().resolveFirst("ProtectedStatic") shouldBe null + it.types().resolveFirst("PrivateStatic") shouldBe null + } } } parserTest("$onDemandStaticImports should import only static members") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; + acu.symbolTable.apply { - acu.symbolTable.apply { + variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null + variables().resolveFirst("publicField") shouldBe null - variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null - variables().resolveFirst("publicField") shouldBe null + resolveMethods("publicMethod").shouldHaveSize(2) + resolveMethods("publicInstanceMethod").shouldHaveSize(0) - resolveMethods("publicMethod").shouldHaveSize(2) - resolveMethods("publicInstanceMethod").shouldHaveSize(0) - - types().resolveFirst("PublicStatic") shouldNotBe null - types().resolveFirst("PublicInner") shouldBe null + types().resolveFirst("PublicStatic") shouldNotBe null + types().resolveFirst("PublicInner") shouldBe null + } } } parserTest("Types imported through $onDemandStaticImports should be shadowed by $typesInTheSamePackage") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; - - acu.symbolTable.types().typeShadowSequence("PublicShadowed") shouldBe - // from same package - listOf(SAME_PACKAGE to "javasymbols.testdata.deep.PublicShadowed", - IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$PublicShadowed") + acu.symbolTable.types().typeShadowSequence("PublicShadowed") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.deep.PublicShadowed", + IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$PublicShadowed" + ) + } } parserTest("Types imported through $onDemandStaticImports should be shadowed by $singleTypeImports") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticIOD2::class.java) + // import javasymbols.testdata.Statics.*; - val acu = parser.parseClass(javasymbols.testdata.deep.StaticIOD2::class.java) - // import javasymbols.testdata.Statics.*; - - acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe - listOf(SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", + acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe + listOf( + SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$SomeClassA" - ) + ) + } } parserTest("$staticSingleMemberImports should import types, fields and methods with the same name") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) + // import javasymbols.testdata.Statics.*; - val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) - // import javasymbols.testdata.Statics.*; - - acu.symbolTable.let { - it.resolveField("Ola") shouldBe classSym(StaticNameCollision::class.java)!!.getDeclaredField("Ola")!! - it.resolveMethods("Ola").shouldContainExactly(classSym(StaticNameCollision::class.java)!!.getDeclaredMethods("Ola").toList()) - it.types().shouldResolveToClass("Ola", "javasymbols.testdata.StaticNameCollision\$Ola") + acu.symbolTable.let { + it.resolveField("Ola") shouldBe classSym(StaticNameCollision::class.java)!!.getDeclaredField("Ola")!! + it.resolveMethods("Ola").shouldContainExactly( + classSym(StaticNameCollision::class.java)!!.getDeclaredMethods("Ola").toList() + ) + it.types().shouldResolveToClass("Ola", "javasymbols.testdata.StaticNameCollision\$Ola") + } } } parserTest("$staticSingleMemberImports should import inherited members") { + doTest { + val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) + // import javasymbols.testdata.Statics.*; - val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) - // import javasymbols.testdata.Statics.*; - - acu.symbolTable.let { - it.resolveField("oha") shouldBe classSym(StaticsSuper::class.java)!!.getDeclaredField("oha")!! - it.resolveMethods("oha").shouldContainExactly(classSym(StaticsSuper::class.java)!!.getDeclaredMethods("oha").toList()) - it.types().shouldResolveToClass("oha", "javasymbols.testdata.StaticsSuper\$oha") + acu.symbolTable.let { + it.resolveField("oha") shouldBe classSym(StaticsSuper::class.java)!!.getDeclaredField("oha")!! + it.resolveMethods("oha") + .shouldContainExactly(classSym(StaticsSuper::class.java)!!.getDeclaredMethods("oha").toList()) + it.types().shouldResolveToClass("oha", "javasymbols.testdata.StaticsSuper\$oha") + } } } @@ -284,10 +312,11 @@ class HeaderScopesTest : ProcessorTestSpec({ parserTest("#3768 static imported type shadows java.lang") { - assertNoSemanticErrorsOrWarnings() + doTest { + assertNoSemanticErrorsOrWarnings() - val acu = parser.parse( - """ + val acu = parser.parse( + """ import static javasymbols.testdata.deep.StaticContainer.Exception; class Foo { @@ -296,16 +325,17 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) + ) - acu.symbolTable.types() - .shouldResolveToClass("Exception", "javasymbols.testdata.deep.StaticContainer\$Exception") + acu.symbolTable.types() + .shouldResolveToClass("Exception", "javasymbols.testdata.deep.StaticContainer\$Exception") + } } parserTest("#3768 static imported type does not shadow non-static imported type") { - - val acu = parser.parse( - """ + doTest { + val acu = parser.parse( + """ import static javasymbols.testdata.deep.StaticContainer.Exception; import java.lang.Exception; @@ -315,22 +345,23 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) - - acu.symbolTable.types().resolve("Exception") - .map { (it.symbol as JClassSymbol).binaryName } - .shouldContainExactlyInAnyOrder( - "javasymbols.testdata.deep.StaticContainer\$Exception", - "java.lang.Exception" ) + + acu.symbolTable.types().resolve("Exception") + .map { (it.symbol as JClassSymbol).binaryName } + .shouldContainExactlyInAnyOrder( + "javasymbols.testdata.deep.StaticContainer\$Exception", + "java.lang.Exception" + ) + } } parserTest("Import of an unconventional name with dollar") { + doTest { + assertNoSemanticErrorsOrWarnings() - assertNoSemanticErrorsOrWarnings() - - val acu = parser.parse( - """ + val acu = parser.parse( + """ import javasymbols.testdata.deep.ClassWithDollar${'$'}; @@ -340,32 +371,34 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) + ) - val moduleAccess = acu.descendants(ASTFieldAccess::class.java).first().shouldNotBeNull() - with(acu.typeDsl) { - moduleAccess shouldHaveType ts.OBJECT - moduleAccess.qualifier.shouldBeA { - it shouldHaveType ts.rawType(ts.getClassSymbol("javasymbols.testdata.deep.ClassWithDollar\$")) + val moduleAccess = acu.descendants(ASTFieldAccess::class.java).first().shouldNotBeNull() + with(acu.typeDsl) { + moduleAccess shouldHaveType ts.OBJECT + moduleAccess.qualifier.shouldBeA { + it shouldHaveType ts.rawType(ts.getClassSymbol("javasymbols.testdata.deep.ClassWithDollar\$")) + } } } } parserTest("Import static on demand with inner (non-static) class") { + doTest { + assertNoSemanticErrorsOrWarnings() - assertNoSemanticErrorsOrWarnings() - - val acu = parser.parse( - """ + val acu = parser.parse( + """ package ${OuterWithoutDollar::class.java.`package`.name}; import static ${OuterWithoutDollar::class.java.name}.*; class Foo { static {} } """ - ) + ) - val block = acu.descendants(ASTBlock::class.java).firstOrThrow() - block.symbolTable.types().resolve("Inner").shouldBeEmpty() + val block = acu.descendants(ASTBlock::class.java).firstOrThrow() + block.symbolTable.types().resolve("Inner").shouldBeEmpty() + } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt index 1ef96da29e..76bb0a6939 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt @@ -145,8 +145,9 @@ class LocalTypeScopesTest : ParserTestSpec({ parserTest("Inner class creation expressions should have inner classes in scope") { - - val acu = parser.withProcessing().parse(""" + doTest { + val acu = parser.withProcessing().parse( + """ package scratch; import java.util.Map.Entry; @@ -171,22 +172,24 @@ class LocalTypeScopesTest : ParserTestSpec({ class KKK { static class I4 {} } - """) + """ + ) - val (n2, mapEntry, kkEntry, n2i2, i4) = + val (n2, mapEntry, kkEntry, n2i2, i4) = acu.descendants(ASTClassType::class.java).toList() - val (_, cKK, cKkEntry, cN2, cN2i2) = + val (_, cKK, cKkEntry, cN2, cN2i2) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - // setup - n2.typeMirror.symbol shouldBe cN2.symbol - mapEntry shouldHaveType with(acu.typeDsl) { java.util.Map.Entry::class.raw } - kkEntry shouldHaveType cKkEntry - (kkEntry.typeMirror as JClassType).enclosingType shouldBe cKK // not cN2! this calls getAsSuper - n2i2 shouldHaveType cN2i2 - i4.typeMirror.symbol?.isUnresolved shouldBe true + // setup + n2.typeMirror.symbol shouldBe cN2.symbol + mapEntry shouldHaveType with(acu.typeDsl) { java.util.Map.Entry::class.raw } + kkEntry shouldHaveType cKkEntry + (kkEntry.typeMirror as JClassType).enclosingType shouldBe cKK // not cN2! this calls getAsSuper + n2i2 shouldHaveType cN2i2 + i4.typeMirror.symbol?.isUnresolved shouldBe true + } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt index 5541e02365..c6338baede 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt @@ -21,9 +21,10 @@ import net.sourceforge.pmd.lang.java.types.* class MemberInheritanceTest : ParserTestSpec({ parserTest("Test problem with values scope in enum") { - inContext(ExpressionParsingCtx) { + doTest { + inContext(ExpressionParsingCtx) { - val acu = parser.withProcessing().parse( + val acu = parser.withProcessing().parse( """ package coco; @@ -44,23 +45,24 @@ class MemberInheritanceTest : ParserTestSpec({ public enum Set { STANDARD, PICOJAVA } } - """.trimIndent()) + """.trimIndent() + ) - val (outer, inner) = acu.descendants(ASTEnumDeclaration::class.java).toList { it.symbol } + val (outer, inner) = acu.descendants(ASTEnumDeclaration::class.java).toList { it.symbol } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("values") { + call.shouldMatchN { + methodCall("values") { - it.symbolTable.methods().resolve("values").shouldBeSingleton { - it.symbol.enclosingClass shouldBe outer + it.symbolTable.methods().resolve("values").shouldBeSingleton { + it.symbol.enclosingClass shouldBe outer + } + + argList(0) {} } - - argList(0) {} } } - } } @@ -219,32 +221,35 @@ class MemberInheritanceTest : ParserTestSpec({ parserTest("Methods of Object are in scope in interfaces") { - - val acu = parser.withProcessing().parse(""" + doTest { + val acu = parser.withProcessing().parse( + """ interface Foo { default Class foo() { return getClass(); } } - """) + """ + ) - val (insideFoo) = + val (insideFoo) = acu.descendants(ASTMethodCall::class.java).toList() - insideFoo.symbolTable.methods().resolve("getClass").also { - it.shouldHaveSize(1) - it[0].apply { - formalParameters shouldBe emptyList() - declaringType shouldBe acu.typeSystem.OBJECT + insideFoo.symbolTable.methods().resolve("getClass").also { + it.shouldHaveSize(1) + it[0].apply { + formalParameters shouldBe emptyList() + declaringType shouldBe acu.typeSystem.OBJECT + } } } - } parserTest("Inner types may be inherited") { - - val acu = parser.withProcessing().parse(""" + doTest { + val acu = parser.withProcessing().parse( + """ class Scratch { class Inner {} @@ -259,31 +264,32 @@ class MemberInheritanceTest : ParserTestSpec({ } } - """) + """ + ) - val (typeScratch, typeInner) = + val (typeScratch, typeInner) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val insideFoo = + val insideFoo = acu.descendants(ASTClassBody::class.java) .crossFindBoundaries().get(2)!! - val `typeScratch{String}Inner` = with (acu.typeDsl) { - typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) - } + val `typeScratch{String}Inner` = with(acu.typeDsl) { + typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) + } - insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { - it.shouldBe(`typeScratch{String}Inner`) - } + insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { + it.shouldBe(`typeScratch{String}Inner`) + } - val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! + val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! - typeNode.shouldMatchN { - classType("Inner") { - it shouldHaveType `typeScratch{String}Inner` + typeNode.shouldMatchN { + classType("Inner") { + it shouldHaveType `typeScratch{String}Inner` + } } } - } @@ -726,8 +732,9 @@ class Impl extends Sup { parserTest("Import of member defined in the file should not fail") { - - val acu = parser.withProcessing().parse(""" + doTest { + val acu = parser.withProcessing().parse( + """ package p; import static p.Top.ClassValueMap.importedMethod; @@ -748,26 +755,30 @@ class Top { int i = importedField; } } - """) + """ + ) - val importedFieldAccess = acu.descendants(ASTVariableAccess::class.java).firstOrThrow() - val importedFieldSym = acu.descendants(ASTVariableId::class.java) - .crossFindBoundaries().firstOrThrow().symbol + val importedFieldAccess = acu.descendants(ASTVariableAccess::class.java).firstOrThrow() + val importedFieldSym = acu.descendants(ASTVariableId::class.java) + .crossFindBoundaries().firstOrThrow().symbol - val importedMethodCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val importedMethodSym = acu.descendants(ASTMethodDeclaration::class.java) - .crossFindBoundaries().firstOrThrow().symbol + val importedMethodCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val importedMethodSym = acu.descendants(ASTMethodDeclaration::class.java) + .crossFindBoundaries().firstOrThrow().symbol - importedFieldAccess.referencedSym shouldBe importedFieldSym - importedMethodCall.methodType.symbol shouldBe importedMethodSym + importedFieldAccess.referencedSym shouldBe importedFieldSym + importedMethodCall.methodType.symbol shouldBe importedMethodSym + } } parserTest("Static methods of interfaces are not in scope in subclasses") { - // This is what allows the import below to not be shadowed by the inherited declaration - // This was tested with javac. The intellij compiler doesn't understand this code. + doTest { + // This is what allows the import below to not be shadowed by the inherited declaration + // This was tested with javac. The intellij compiler doesn't understand this code. - val acu = parser.withProcessing().parse(""" + val acu = parser.withProcessing().parse( + """ package p; import static p.Top2.foo; @@ -793,21 +804,22 @@ interface Top { interface Top2 { static void foo() {} } - """) + """ + ) - val (fooInTop1, _, fooInTop2) = acu.methodDeclarations().toList() - val (call1, call2, callInBar) = acu.methodCalls().crossFindBoundaries().toList() + val (fooInTop1, _, fooInTop2) = acu.methodDeclarations().toList() + val (call1, call2, callInBar) = acu.methodCalls().crossFindBoundaries().toList() - withClue(call1) { - call1.methodType.symbol shouldBe fooInTop2.symbol + withClue(call1) { + call1.methodType.symbol shouldBe fooInTop2.symbol + } + withClue(call2) { + call2.methodType.symbol shouldBe fooInTop2.symbol + } + withClue(callInBar) { + callInBar.methodType.symbol shouldBe fooInTop1.symbol + } } - withClue(call2) { - call2.methodType.symbol shouldBe fooInTop2.symbol - } - withClue(callInBar) { - callInBar.methodType.symbol shouldBe fooInTop1.symbol - } - } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt index fa253394da..e99c36ad39 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt @@ -184,9 +184,9 @@ class PatternVarScopingTests : ProcessorTestSpec({ parserTest("Bindings within labeled stmt", javaVersion = JavaVersion.J17) { - - checkVars(firstIsPattern = false, secondIsPattern = true) { - """ + doTest { + checkVars(firstIsPattern = false, secondIsPattern = true) { + """ a -> { label: if (!(a instanceof String var)) { @@ -196,13 +196,14 @@ class PatternVarScopingTests : ProcessorTestSpec({ var.toString(); // the binding } """ + } } } parserTest("Bindings within switch expr with yield", javaVersion = JavaVersion.J17) { - - checkVars(firstIsPattern = false, secondIsPattern = true) { - """ + doTest { + checkVars(firstIsPattern = false, secondIsPattern = true) { + """ a -> switch (1) { case 1 -> { if (!(a instanceof String var)) { @@ -214,6 +215,7 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } """ + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 6f4eef0e86..2925d77b91 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt @@ -379,8 +379,9 @@ class VarScopingTest : ProcessorTestSpec({ parserTest("Foreach with no braces") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.*; import java.io.*; class Outer { @@ -395,21 +396,23 @@ class VarScopingTest : ProcessorTestSpec({ return files.toArray(new File[files.size()]); } } - """.trimIndent()) + """.trimIndent() + ) - val foreachVar = + val foreachVar = acu.descendants(ASTVariableId::class.java).first { it.name == "s" }!! - val foreachBody = + val foreachBody = acu.descendants(ASTForeachStatement::class.java).firstOrThrow().body - foreachBody shouldResolveToLocal foreachVar - + foreachBody shouldResolveToLocal foreachVar + } } parserTest("Switch on enum has field names in scope") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { @@ -432,45 +435,46 @@ class VarScopingTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (enumA, enumB) = + val (enumA, enumB) = acu.descendants(ASTEnumDeclaration::class.java) - .descendants(ASTVariableId::class.java).toList() + .descendants(ASTVariableId::class.java).toList() - val (e, caseA, caseB) = + val (e, caseA, caseB) = acu.descendants(ASTVariableAccess::class.java).toList() - val (qualifiedA) = + val (qualifiedA) = acu.descendants(ASTFieldAccess::class.java).toList() - val (fooCall) = + val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() - qualifiedA.referencedSym shouldBe enumA.symbol - qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA - qualifiedA shouldHaveType typeSomeEnum + qualifiedA.referencedSym shouldBe enumA.symbol + qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA + qualifiedA shouldHaveType typeSomeEnum - caseA.referencedSym shouldBe enumA.symbol - caseA.referencedSym!!.tryGetNode() shouldBe enumA - caseA shouldHaveType typeSomeEnum + caseA.referencedSym shouldBe enumA.symbol + caseA.referencedSym!!.tryGetNode() shouldBe enumA + caseA shouldHaveType typeSomeEnum - caseB.referencedSym shouldBe enumB.symbol - caseB.referencedSym!!.tryGetNode() shouldBe enumB - caseB shouldHaveType typeSomeEnum + caseB.referencedSym shouldBe enumB.symbol + caseB.referencedSym!!.tryGetNode() shouldBe enumB + caseB shouldHaveType typeSomeEnum - e shouldHaveType typeSomeEnum + e shouldHaveType typeSomeEnum - // symbol tables don't carry that info, this is documented on JSymbolTable#variables() - caseB.symbolTable.variables().resolve("A").shouldBeEmpty() - caseB.symbolTable.variables().resolve("B").shouldBeEmpty() + // symbol tables don't carry that info, this is documented on JSymbolTable#variables() + caseB.symbolTable.variables().resolve("A").shouldBeEmpty() + caseB.symbolTable.variables().resolve("B").shouldBeEmpty() - fooCall.qualifier!!.shouldMatchN { - ambiguousName("A") + fooCall.qualifier!!.shouldMatchN { + ambiguousName("A") + } } - } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt index 3b9b28c748..759896b7a5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt @@ -90,9 +90,10 @@ class InnerTypesTest : ProcessorTestSpec({ } parserTest("Test erased types overload resolution") { + doTest { - - val acu = parser.parse(""" + val acu = parser.parse( + """ class Scratch { class Inner { } @@ -109,41 +110,43 @@ class InnerTypesTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val (scratch, inner) = + val (scratch, inner) = acu.descendants(ASTTypeDeclaration::class.java).toList() - val (call, rawCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (call, rawCall) = acu.descendants(ASTMethodCall::class.java).toList() - val t_Scratch = scratch.typeMirror - val t_Inner = inner.typeMirror + val t_Scratch = scratch.typeMirror + val t_Inner = inner.typeMirror - call.shouldMatchN { - methodCall("doStuff") { - it.methodType.formalParameters[0].shouldBe(t_Inner) - argList { - variableAccess("raw") { - it.typeMirror.shouldBe(t_Inner.erasure) + call.shouldMatchN { + methodCall("doStuff") { + it.methodType.formalParameters[0].shouldBe(t_Inner) + argList { + variableAccess("raw") { + it.typeMirror.shouldBe(t_Inner.erasure) + } } } } - } - rawCall.shouldMatchN { - methodCall("doStuff") { - it.methodType.formalParameters[0].shouldBe(t_Inner.erasure) + rawCall.shouldMatchN { + methodCall("doStuff") { + it.methodType.formalParameters[0].shouldBe(t_Inner.erasure) - variableAccess("rawScratch") { - it.typeMirror.shouldBe(t_Scratch.erasure) - } - argList { - variableAccess("notRaw") { - it shouldHaveType with(it.typeDsl) { - t_Scratch[ts.STRING].selectInner(inner.symbol, emptyList()) + variableAccess("rawScratch") { + it.typeMirror.shouldBe(t_Scratch.erasure) + } + argList { + variableAccess("notRaw") { + it shouldHaveType with(it.typeDsl) { + t_Scratch[ts.STRING].selectInner(inner.symbol, emptyList()) + } } } } @@ -207,8 +210,9 @@ class O { } parserTest("Capturing an inner type captures the enclosing type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { class Inner { @@ -219,15 +223,16 @@ class Scratch { var k = i.getT(); } } - """.trimIndent()) + """.trimIndent() + ) - val kvar = acu.typeVar("K") + val kvar = acu.typeVar("K") - spy.shouldBeOk { - // not - acu.varId("k") shouldHaveType kvar + spy.shouldBeOk { + // not + acu.varId("k") shouldHaveType kvar + } } - } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt index bee95e1449..5a3763f1e0 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt @@ -12,37 +12,39 @@ import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec class JMethodSigTest : ProcessorTestSpec({ parserTest("Test erasure of generic method") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package p; class Foo { T method(A a, B b) throws E {} }""" - ) + ) - val (a, b, t, e) = acu.typeVariables() - spy.shouldBeOk { - val m = acu.declaredMethodSignatures()[0].also { - it.formalParameters shouldBe listOf(a, b) - it.returnType shouldBe t - it.typeParameters shouldBe listOf(t, e) - it.thrownExceptions shouldBe listOf(e) + val (a, b, t, e) = acu.typeVariables() + spy.shouldBeOk { + val m = acu.declaredMethodSignatures()[0].also { + it.formalParameters shouldBe listOf(a, b) + it.returnType shouldBe t + it.typeParameters shouldBe listOf(t, e) + it.thrownExceptions shouldBe listOf(e) - it.toString() shouldBe "p.Foo. method(A, B extends java.lang.Number) -> T" - } + it.toString() shouldBe "p.Foo. method(A, B extends java.lang.Number) -> T" + } - m.erasure.also { - it.formalParameters shouldBe listOf(a.erasure, b.erasure) - it.returnType shouldBe t.erasure - it.typeParameters shouldBe emptyList() - it.thrownExceptions shouldBe listOf(e.erasure) + m.erasure.also { + it.formalParameters shouldBe listOf(a.erasure, b.erasure) + it.returnType shouldBe t.erasure + it.typeParameters shouldBe emptyList() + it.thrownExceptions shouldBe listOf(e.erasure) - a.erasure shouldBe ts.OBJECT - b.erasure shouldBe java.lang.Number::class.java.decl - e.erasure shouldBe java.lang.RuntimeException::class.java.decl + a.erasure shouldBe ts.OBJECT + b.erasure shouldBe java.lang.Number::class.java.decl + e.erasure shouldBe java.lang.RuntimeException::class.java.decl - it.toString() shouldBe "p.Foo.method(java.lang.Object, java.lang.Number) -> java.lang.Object" + it.toString() shouldBe "p.Foo.method(java.lang.Object, java.lang.Number) -> java.lang.Object" + } } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt index 676362d2bb..8315a521c1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt @@ -14,8 +14,9 @@ import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec class SamTypesTest : ProcessorTestSpec({ parserTest("Test SAM when some default overrides an abstract method") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ interface Top { void accept(T t); @@ -27,16 +28,19 @@ interface Sub extends Top { void accept(int i); // this is the single abstract method of Sub } - """.trimIndent()) + """.trimIndent() + ) - val (t_Top, t_Sub) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (topAccept, subAcceptOverride, subAccept) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.genericSignature } + val (t_Top, t_Sub) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (topAccept, subAcceptOverride, subAccept) = acu.descendants(ASTMethodDeclaration::class.java) + .toList { it.genericSignature } - TypeOps.findFunctionalInterfaceMethod(t_Top) shouldBe topAccept + TypeOps.findFunctionalInterfaceMethod(t_Top) shouldBe topAccept - TypeOps.findFunctionalInterfaceMethod(t_Sub) shouldBe subAccept + TypeOps.findFunctionalInterfaceMethod(t_Sub) shouldBe subAccept - TypeOps.overrides(subAcceptOverride, topAccept, t_Sub) shouldBe true + TypeOps.overrides(subAcceptOverride, topAccept, t_Sub) shouldBe true + } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt index 929d47bfdd..13df3abf05 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt @@ -18,10 +18,11 @@ class SubstTest : ProcessorTestSpec({ parserTest("Test full test case") { + doTest { - - val typeDecl = - parser.parse(""" + val typeDecl = + parser.parse( + """ package java.util; class Foo, Map> field; } - """).descendants(ASTClassDeclaration::class.java).firstOrThrow() + """ + ).descendants(ASTClassDeclaration::class.java).firstOrThrow() - val typeDsl = typeDecl.typeDsl + val typeDsl = typeDecl.typeDsl - val (k, f, c) = typeDecl.typeMirror.formalTypeParams + val (k, f, c) = typeDecl.typeMirror.formalTypeParams - val fieldT = typeDecl.descendants(ASTClassType::class.java).drop(2).firstOrThrow() - - val map = Map::class + val fieldT = typeDecl.descendants(ASTClassType::class.java).drop(2).firstOrThrow() - // assert the form of the type - fieldT shouldHaveType with (typeDsl) { - map[map[k, f], map[f, c]] - } + val map = Map::class - val `List{F}` = with (typeDsl) { List::class[f] } + // assert the form of the type + fieldT shouldHaveType with(typeDsl) { + map[map[k, f], map[f, c]] + } - val subst = - Substitution.mapping( + val `List{F}` = with(typeDsl) { List::class[f] } + + val subst = + Substitution.mapping( listOf(k, f), listOf(`List{F}`, k) - ) + ) - subst.apply(f) shouldBe k - subst.apply(k) shouldBe `List{F}` + subst.apply(f) shouldBe k + subst.apply(k) shouldBe `List{F}` - val subbed = TypeOps.subst(fieldT.typeMirror, subst) + val subbed = TypeOps.subst(fieldT.typeMirror, subst) - subbed shouldBe with (typeDsl) { - map[map[`List{F}`, k], map[k, c]] + subbed shouldBe with(typeDsl) { + map[map[`List{F}`, k], map[k, c]] + } } } @@ -75,59 +78,61 @@ class SubstTest : ProcessorTestSpec({ parserTest("Test simple subst") { + doTest { + + val (a, b, c) = makeDummyTVars("A", "B", "C") + + with(TypeDslOf(a.typeSystem)) { + val `t_List{A}` = List::class[a] + val `t_Iter{B}` = Iterable::class[b] + val `t_Coll{C}` = Collection::class[c] - val (a, b, c) = makeDummyTVars("A", "B", "C") + val sub1 = subOf(a to `t_Iter{B}`) + val sub2 = subOf(b to `t_Coll{C}`) - with(TypeDslOf(a.typeSystem)) { - val `t_List{A}` = List::class[a] - val `t_Iter{B}` = Iterable::class[b] - val `t_Coll{C}` = Collection::class[c] + val `t_List{Iter{B}}` = sub1(`t_List{A}`) + + `t_List{Iter{B}}` shouldBe List::class[Iterable::class[b]] + + val `t_List{Iter{t_Coll{C}}}` = sub2(`t_List{Iter{B}}`) + + `t_List{Iter{t_Coll{C}}}` shouldBe List::class[Iterable::class[Collection::class[c]]] - val sub1 = subOf(a to `t_Iter{B}`) - val sub2 = subOf(b to `t_Coll{C}`) + val composed = sub1.andThen(sub2) - val `t_List{Iter{B}}` = sub1(`t_List{A}`) + composed.map should contain(a, Iterable::class[Collection::class[c]]) - `t_List{Iter{B}}` shouldBe List::class[Iterable::class[b]] + composed.map.shouldContainExactly( + mapOf( + a to Iterable::class[Collection::class[c]], + b to `t_Coll{C}` + ) + ) - val `t_List{Iter{t_Coll{C}}}` = sub2(`t_List{Iter{B}}`) - - `t_List{Iter{t_Coll{C}}}` shouldBe List::class[Iterable::class[Collection::class[c]]] - - - val composed = sub1.andThen(sub2) - - composed.map should contain(a, Iterable::class[Collection::class[c]]) - - composed.map.shouldContainExactly(mapOf( - a to Iterable::class[Collection::class[c]], - b to `t_Coll{C}` - )) - - composed(`t_List{A}`) shouldBe `t_List{Iter{t_Coll{C}}}` + composed(`t_List{A}`) shouldBe `t_List{Iter{t_Coll{C}}}` + } } - } parserTest("Test subst toString") { + doTest { + + val (a, b, c) = makeDummyTVars("A", "B", "C") + + with(TypeDslOf(a.typeSystem)) { + val `t_Iter{B}` = Iterable::class[b] + val `t_Coll{C}` = Collection::class[c] - val (a, b, c) = makeDummyTVars("A", "B", "C") + val sub1 = subOf(a to `t_Iter{B}`, b to `t_Coll{C}`) - with(TypeDslOf(a.typeSystem)) { - val `t_Iter{B}` = Iterable::class[b] - val `t_Coll{C}` = Collection::class[c] - - - val sub1 = subOf(a to `t_Iter{B}`, b to `t_Coll{C}`) - - sub1.toString() shouldBe "Substitution[A => java.lang.Iterable; B => java.util.Collection]" + sub1.toString() shouldBe "Substitution[A => java.lang.Iterable; B => java.util.Collection]" + } } - } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt index b0a9f22821..0a46893cfe 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt @@ -18,9 +18,10 @@ class TypesFromAstTest : ProcessorTestSpec({ parserTest("Test primitive types are reused") { - - val (tf1, tf2) = - parser.parse(""" + doTest { + val (tf1, tf2) = + parser.parse( + """ package java.util; class Foo { @@ -32,41 +33,43 @@ class TypesFromAstTest : ProcessorTestSpec({ } } - """) - .descendants(ASTFieldDeclaration::class.java) - .crossFindBoundaries() - .map { it.typeNode } - .toList() + """ + ) + .descendants(ASTFieldDeclaration::class.java) + .crossFindBoundaries() + .map { it.typeNode } + .toList() - tf1.shouldMatchN { + tf1.shouldMatchN { - classType("Inner") { + classType("Inner") { - it.typeMirror.toString() shouldBe "java.util.Foo#Inner" + it.typeMirror.toString() shouldBe "java.util.Foo#Inner" - classType("Foo") { + classType("Foo") { - it.typeMirror.toString() shouldBe "java.util.Foo" + it.typeMirror.toString() shouldBe "java.util.Foo" + + typeArgList { + classType("K") + } + } typeArgList { - classType("K") + classType("T") } } - - typeArgList { - classType("T") - } } - } - tf2.shouldMatchN { + tf2.shouldMatchN { - classType("Inner") { + classType("Inner") { - it.typeMirror.toString() shouldBe "java.util.Foo#Inner" + it.typeMirror.toString() shouldBe "java.util.Foo#Inner" - typeArgList { - classType("T") + typeArgList { + classType("T") + } } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 03ae05f13e..16e71682c5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -18,110 +18,123 @@ import net.sourceforge.pmd.lang.java.types.shouldHaveType class ConversionContextTests : ProcessorTestSpec({ parserTest("Test simple contexts") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { double foo() { String.valueOf((Double) 1d); return 2; } } - """) + """ + ) - val (valueOf, _, doubleCast, doubleLit, intLit) = acu.descendants(ASTExpression::class.java).toList() + val (valueOf, _, doubleCast, doubleLit, intLit) = acu.descendants(ASTExpression::class.java).toList() - spy.shouldBeOk { - valueOf.conversionContext::isMissing shouldBe true - doubleCast.conversionContext::getTargetType shouldBe ts.OBJECT - doubleLit.conversionContext::getTargetType shouldBe double.box() - intLit.conversionContext::getTargetType shouldBe double + spy.shouldBeOk { + valueOf.conversionContext::isMissing shouldBe true + doubleCast.conversionContext::getTargetType shouldBe ts.OBJECT + doubleLit.conversionContext::getTargetType shouldBe double.box() + intLit.conversionContext::getTargetType shouldBe double + } } } parserTest("Test standalone ternary context") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { double foo() { double r = true ? 1 : (short) 5; return 2; } } - """) + """ + ) - val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() - spy.shouldBeOk { - // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe false - ternary.conversionContext::getTargetType shouldBe double + spy.shouldBeOk { + // ternary is in double assignment context + ternary.conversionContext::isMissing shouldBe false + ternary.conversionContext::getTargetType shouldBe double - // but it has type int - ternary shouldHaveType int + // but it has type int + ternary shouldHaveType int - // more importantly, both branch expressions have context int and not double + // more importantly, both branch expressions have context int and not double - num1 shouldHaveType int - shortCast shouldHaveType short + num1 shouldHaveType int + shortCast shouldHaveType short - num1.conversionContext::getTargetType shouldBe int - shortCast.conversionContext::getTargetType shouldBe int + num1.conversionContext::getTargetType shouldBe int + shortCast.conversionContext::getTargetType shouldBe int + } } } parserTest("Test standalone ternary context (2, boxing)") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { double foo(Integer i, Long l, boolean c) { var z = c ? (Integer) null : 4; } } - """) + """ + ) - val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() - spy.shouldBeOk { - // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe true - ternary.conversionContext::getTargetType shouldBe null + spy.shouldBeOk { + // ternary is in double assignment context + ternary.conversionContext::isMissing shouldBe true + ternary.conversionContext::getTargetType shouldBe null - // but it has type int - ternary shouldHaveType int + // but it has type int + ternary shouldHaveType int - // more importantly, both branch expressions have context int and not double + // more importantly, both branch expressions have context int and not double - integerCast shouldHaveType int.box() - num4 shouldHaveType int + integerCast shouldHaveType int.box() + num4 shouldHaveType int - integerCast.conversionContext::getTargetType shouldBe int - num4.conversionContext::getTargetType shouldBe int + integerCast.conversionContext::getTargetType shouldBe int + num4.conversionContext::getTargetType shouldBe int + } } } parserTest("Test context of assert stmt") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static void m(Boolean boxedBool, boolean bool, String str) { assert boxedBool; assert bool : str; } } - """) + """ + ) - val (boxedBool, bool, str) = acu.descendants(ASTVariableAccess::class.java).toList() + val (boxedBool, bool, str) = acu.descendants(ASTVariableAccess::class.java).toList() - spy.shouldBeOk { - boxedBool.conversionContext::getTargetType shouldBe ts.BOOLEAN - bool.conversionContext::getTargetType shouldBe ts.BOOLEAN - str.conversionContext::getTargetType shouldBe ts.STRING + spy.shouldBeOk { + boxedBool.conversionContext::getTargetType shouldBe ts.BOOLEAN + bool.conversionContext::getTargetType shouldBe ts.BOOLEAN + str.conversionContext::getTargetType shouldBe ts.STRING + } } } parserTest("Test context of statements with conditions") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { if (boxedBool); @@ -131,62 +144,72 @@ class ConversionContextTests : ProcessorTestSpec({ for (int i : ints); } } - """) + """ + ) - val (ifstmt, whilestmt, forstmt, _, dostmt, foreachstmt) = acu.descendants(ASTVariableAccess::class.java).toList() - val forUpdate = acu.descendants(ASTForUpdate::class.java).firstOrThrow().exprList[0] + val (ifstmt, whilestmt, forstmt, _, dostmt, foreachstmt) = acu.descendants(ASTVariableAccess::class.java) + .toList() + val forUpdate = acu.descendants(ASTForUpdate::class.java).firstOrThrow().exprList[0] - spy.shouldBeOk { + spy.shouldBeOk { - ifstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - whilestmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - forstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - dostmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + ifstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + whilestmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + forstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + dostmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - forUpdate.conversionContext::getTargetType shouldBe null - foreachstmt.conversionContext::getTargetType shouldBe null + forUpdate.conversionContext::getTargetType shouldBe null + foreachstmt.conversionContext::getTargetType shouldBe null + } } } parserTest("Test missing context in qualifier") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static void m(Boolean boxedBool) { ((Boolean) boxedBool).booleanValue(); ((Object) boxedBool).somefield; } } - """) + """ + ) - val (booleanCast, objectCast) = acu.descendants(ASTCastExpression::class.java).toList() + val (booleanCast, objectCast) = acu.descendants(ASTCastExpression::class.java).toList() - spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe null - objectCast.conversionContext::getTargetType shouldBe null + spy.shouldBeOk { + booleanCast.conversionContext::getTargetType shouldBe null + objectCast.conversionContext::getTargetType shouldBe null + } } } parserTest("Test context of ternary condition") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { str = (boolean) boxedBool ? "a" : "b"; } } - """) + """ + ) - val (booleanCast) = acu.descendants(ASTCastExpression::class.java).toList() + val (booleanCast) = acu.descendants(ASTCastExpression::class.java).toList() - spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe boolean + spy.shouldBeOk { + booleanCast.conversionContext::getTargetType shouldBe boolean + } } } parserTest("Test numeric context") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static void m() { int i, j, k; @@ -201,28 +224,31 @@ class ConversionContextTests : ProcessorTestSpec({ } void eat(double d) {} } - """) + """ + ) - val (mulint, lshift, and, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() + val (mulint, lshift, and, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - listOf(mulint, lshift, and).forEach { - withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.INT - it.rightOperand.conversionContext::getTargetType shouldBe ts.INT + spy.shouldBeOk { + listOf(mulint, lshift, and).forEach { + withClue(it) { + it.leftOperand.conversionContext::getTargetType shouldBe ts.INT + it.rightOperand.conversionContext::getTargetType shouldBe ts.INT + } } - } - listOf(plusdouble, muldouble).forEach { - withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE - it.rightOperand.conversionContext::getTargetType shouldBe ts.DOUBLE + listOf(plusdouble, muldouble).forEach { + withClue(it) { + it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE + it.rightOperand.conversionContext::getTargetType shouldBe ts.DOUBLE + } } } } } parserTest("String contexts") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static void m(int i) { eat(" " + i); @@ -232,23 +258,27 @@ class ConversionContextTests : ProcessorTestSpec({ } void eat(Object d) {} } - """) + """ + ) - val concats = acu.descendants(ASTInfixExpression::class.java).toList() + val concats = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - concats.forEach { - withClue(it) { - JavaAstUtils.isStringConcatExpr(it) shouldBe true - it.leftOperand.conversionContext::getTargetType shouldBe ts.STRING - it.rightOperand.conversionContext::getTargetType shouldBe ts.STRING + spy.shouldBeOk { + concats.forEach { + withClue(it) { + JavaAstUtils.isStringConcatExpr(it) shouldBe true + it.leftOperand.conversionContext::getTargetType shouldBe ts.STRING + it.rightOperand.conversionContext::getTargetType shouldBe ts.STRING + } } } } } - parserTest("Relational ops") { - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + parserTest("Relational ops") { + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static void m(int i) { eat(i < i++); //l0 @@ -256,16 +286,18 @@ class ConversionContextTests : ProcessorTestSpec({ } void eat(Object d) {} } - """) + """ + ) - val (l0, l1) = acu.descendants(ASTInfixExpression::class.java).toList() + val (l0, l1) = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - l0.leftOperand.conversionContext::getTargetType shouldBe int - l0.rightOperand.conversionContext::getTargetType shouldBe int + spy.shouldBeOk { + l0.leftOperand.conversionContext::getTargetType shouldBe int + l0.rightOperand.conversionContext::getTargetType shouldBe int - l1.leftOperand.conversionContext::getTargetType shouldBe long - l1.rightOperand.conversionContext::getTargetType shouldBe long + l1.leftOperand.conversionContext::getTargetType shouldBe long + l1.rightOperand.conversionContext::getTargetType shouldBe long + } } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt index f97495cb6b..25a13c161f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt @@ -19,8 +19,8 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Diamond anonymous class constructor") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Scratch { @@ -34,41 +34,43 @@ class AnonCtorsTest : ProcessorTestSpec({ Integer result2 = useGen(new Gen<>() { public Integer get() { return 1; } }); } } - """) + """ + ) - val (t_Scratch, t_Gen, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_Gen, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).get(1)!! + val call = acu.descendants(ASTMethodCall::class.java).get(1)!! - call.shouldMatchN { - methodCall("useGen") { + call.shouldMatchN { + methodCall("useGen") { - it.methodType.formalParameters.shouldBe(listOf(with(it.typeDsl) { - t_Gen[`?` extends int.box()] // Gen - })) + it.methodType.formalParameters.shouldBe(listOf(with(it.typeDsl) { + t_Gen[`?` extends int.box()] // Gen + })) - argList { - constructorCall { - classType("Gen") { - it shouldHaveType t_Gen.erasure - diamond() - } + argList { + constructorCall { + classType("Gen") { + it shouldHaveType t_Gen.erasure + diamond() + } - argList(0) + argList(0) - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = ts.OBJECT, withFormals = emptyList(), returning = t_Gen[int.box()] // Gen - ).also { - it.symbol shouldBe ts.OBJECT.symbol.constructors[0] + ).also { + it.symbol shouldBe ts.OBJECT.symbol.constructors[0] + } } - } - child(ignoreChildren = true) { - it shouldHaveType t_Anon + child(ignoreChildren = true) { + it shouldHaveType t_Anon + } } } } @@ -78,8 +80,8 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Test anonymous interface constructor") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Scratch { public interface BitMetric { @@ -92,42 +94,44 @@ class AnonCtorsTest : ProcessorTestSpec({ } }; } - """) + """ + ) - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - call.shouldMatchN { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } + call.shouldMatchN { + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol + } - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = ts.OBJECT, withFormals = emptyList(), returning = t_BitMetric - ).also { - it.symbol shouldBe ts.OBJECT.symbol.constructors[0] + ).also { + it.symbol shouldBe ts.OBJECT.symbol.constructors[0] + } } + it shouldHaveType t_BitMetric + + argList {} + + child(ignoreChildren = true) {} } - it shouldHaveType t_BitMetric - - argList {} - - child(ignoreChildren = true) {} } } - } parserTest("Test anonymous class constructor") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Scratch { public abstract class BitMetric { @@ -142,44 +146,47 @@ class AnonCtorsTest : ProcessorTestSpec({ } }; } - """) + """ + ) - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - call.shouldMatchN { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } + call.shouldMatchN { + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol + } - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_BitMetric, withFormals = listOf(int), returning = t_BitMetric - ).also { - it.symbol shouldBe t_BitMetric.symbol.constructors[0] + ).also { + it.symbol shouldBe t_BitMetric.symbol.constructors[0] + } } - } - argList { - int(4) - } + argList { + int(4) + } - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } } } } } parserTest("Test qualified anonymous class constructor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch { @@ -192,37 +199,39 @@ class AnonCtorsTest : ProcessorTestSpec({ }; } } - """) + """ + ) - val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) + spy.shouldBeOk { + call.shouldMatchN { + constructorCall { + unspecifiedChildren(2) - it shouldHaveType t_Inner + it shouldHaveType t_Inner - t_Inner.shouldBeA { - it.enclosingType shouldBe t_Scratch - } + t_Inner.shouldBeA { + it.enclosingType shouldBe t_Scratch + } - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Inner, withFormals = emptyList(), returning = t_Inner - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } - argList(0) + argList(0) - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } } } } @@ -232,8 +241,8 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Test qualified diamond anonymous class constructor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch { @@ -250,37 +259,39 @@ class AnonCtorsTest : ProcessorTestSpec({ }; } } - """) + """ + ) - val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) + spy.shouldBeOk { + call.shouldMatchN { + constructorCall { + unspecifiedChildren(2) - it shouldHaveType t_Inner[gen.t_String] + it shouldHaveType t_Inner[gen.t_String] - t_Inner.shouldBeA { - it.enclosingType shouldBe t_Scratch - } + t_Inner.shouldBeA { + it.enclosingType shouldBe t_Scratch + } - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Inner[gen.t_String], withFormals = emptyList(), returning = t_Inner[gen.t_String] - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } - argList(0) + argList(0) - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } } } } @@ -290,9 +301,9 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Test qualified diamond anonymous class constructor, depending on disambig in sibling tree") { + doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ package p.q; @@ -323,47 +334,49 @@ class AnonCtorsTest : ProcessorTestSpec({ Q fooField; } } - """) + """ + ) - val (t_Scratch, t_Inner, t_Anon, t_Foo) = acu.declaredTypeSignatures() + val (t_Scratch, t_Inner, t_Anon, t_Foo) = acu.declaredTypeSignatures() - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - val fieldAccess = acu.descendants(ASTVariableAccess::class.java).crossFindBoundaries().firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val fieldAccess = acu.descendants(ASTVariableAccess::class.java).crossFindBoundaries().firstOrThrow() - spy.shouldBeOk { + spy.shouldBeOk { - // Scratch.Inner - val innerT = t_Scratch[int.box()] / t_Inner[gen.t_String] + // Scratch.Inner + val innerT = t_Scratch[int.box()] / t_Inner[gen.t_String] - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) + call.shouldMatchN { + constructorCall { + unspecifiedChildren(2) - it shouldHaveType innerT + it shouldHaveType innerT - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = innerT, withFormals = emptyList(), returning = innerT - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } - argList(0) + argList(0) - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } } } - } - fieldAccess.shouldMatchN { - variableAccess("fooField") { - it shouldHaveType int.box() + fieldAccess.shouldMatchN { + variableAccess("fooField") { + it shouldHaveType int.box() + } } } } @@ -372,9 +385,9 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Test anonymous interface constructor in invocation ctx") { + doTest { - - val acu = parser.parse( + val acu = parser.parse( """ class Scratch { public interface BitMetric { @@ -389,44 +402,47 @@ class AnonCtorsTest : ProcessorTestSpec({ } }); } - """) + """ + ) - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("generic") { + call.shouldMatchN { + methodCall("generic") { - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = "generic", declaredIn = t_Scratch, withFormals = listOf(t_BitMetric), returning = t_BitMetric - ) + ) - argList { + argList { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol + } - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = call.typeSystem.OBJECT, withFormals = emptyList(), returning = t_BitMetric - ).also { - it.symbol shouldBe call.typeSystem.OBJECT.symbol.constructors[0] + ).also { + it.symbol shouldBe call.typeSystem.OBJECT.symbol.constructors[0] + } + + it shouldHaveType t_BitMetric + + argList {} + + child(ignoreChildren = true) {} } - - it shouldHaveType t_BitMetric - - argList {} - - child(ignoreChildren = true) {} } } } @@ -435,9 +451,9 @@ class AnonCtorsTest : ProcessorTestSpec({ parserTest("Test new method in anonymous class") { + doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ interface Scratch { @@ -445,34 +461,37 @@ class AnonCtorsTest : ProcessorTestSpec({ int someNewMethod() { return 2; } }.someNewMethod(); } - """) + """ + ) - val (t_Scratch, t_Anon) = acu.declaredTypeSignatures() + val (t_Scratch, t_Anon) = acu.declaredTypeSignatures() - val (methodDecl) = acu.declaredMethodSignatures() - val call = acu.firstMethodCall() + val (methodDecl) = acu.declaredMethodSignatures() + val call = acu.firstMethodCall() - methodDecl.modifiers shouldBe 0 + methodDecl.modifiers shouldBe 0 - spy.shouldBeOk { - call.shouldMatchN { - methodCall("someNewMethod") { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("someNewMethod") { - it.qualifier!! shouldHaveType t_Scratch - it.methodType shouldBeSomeInstantiationOf methodDecl + it.qualifier!! shouldHaveType t_Scratch + it.methodType shouldBeSomeInstantiationOf methodDecl - it::getQualifier shouldBe unspecifiedChild() + it::getQualifier shouldBe unspecifiedChild() - argList(0) + argList(0) + } } } } } parserTest("Anon in anon") { - // this used to be a stackoverflow + doTest { + // this used to be a stackoverflow - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ public class InputMissingOverrideBadAnnotation { @@ -486,20 +505,24 @@ class AnonCtorsTest : ProcessorTestSpec({ } }; } - """) + """ + ) - val call = acu.firstCtorCall() + val call = acu.firstCtorCall() .firstCtorCall() - spy.shouldBeOk { - call shouldHaveType java.lang.Throwable::class.decl + spy.shouldBeOk { + call shouldHaveType java.lang.Throwable::class.decl + } } } parserTest("Disambiguation of foreach when deferred") { - enableProcessing() + doTest { + enableProcessing() - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package p; import java.util.function.Consumer; class Assert { @@ -515,18 +538,22 @@ class Assert { static void foo(T a, Consumer i) {} } - """) + """ + ) - spy.shouldBeOk { - acu.descendants(ASTConstructorCall::class.java) + spy.shouldBeOk { + acu.descendants(ASTConstructorCall::class.java) .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] + } } } parserTest("Disambiguation of when deferred, local var decl") { - enableProcessing() + doTest { + enableProcessing() - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package p; import java.util.function.Consumer; class Assert { @@ -537,11 +564,13 @@ class Assert { static void foo(T a, Consumer i) {} } - """) + """ + ) - spy.shouldBeOk { - acu.descendants(ASTConstructorCall::class.java) + spy.shouldBeOk { + acu.descendants(ASTConstructorCall::class.java) .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] + } } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt index 9a0fcf643c..cf75a42113 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt @@ -240,8 +240,9 @@ class BranchingExprsTests : ProcessorTestSpec({ parserTest("Cast context doesn't influence standalone ternary") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { static void putBoolean(byte[] b, int off, boolean val) { @@ -249,16 +250,18 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() - ternary.shouldMatchN { - ternaryExpr { - it.typeMirror.shouldBePrimitive(INT) - variableAccess("val") - int(1) - int(0) + ternary.shouldMatchN { + ternaryExpr { + it.typeMirror.shouldBePrimitive(INT) + variableAccess("val") + int(1) + int(0) + } } } } @@ -266,8 +269,9 @@ class Scratch { parserTest("Cast context doesn't provide target type (only for lambdas)") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collection; import java.util.List; import java.util.Set; @@ -289,19 +293,22 @@ class Scratch { List emptyList() {return null;} Set emptySet() {return null;} } - """.trimIndent()) + """.trimIndent() + ) - val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - ternary1 shouldHaveType gen.t_Collection[captureMatcher(`?`)] // java.util.Collection - ternary2 shouldHaveType gen.`t_Collection{String}` // java.util.Collection + spy.shouldBeOk { + ternary1 shouldHaveType gen.t_Collection[captureMatcher(`?`)] // java.util.Collection + ternary2 shouldHaveType gen.`t_Collection{String}` // java.util.Collection + } } } parserTest("Null branches produce null type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collection; class Test { Collection fun(boolean messageSelector) { @@ -311,13 +318,15 @@ class Scratch { return (Collection) (messageSelector ? null : null); } } - """.trimIndent()) + """.trimIndent() + ) - val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - ternary1 shouldHaveType java.util.Collection::class[ts.STRING] - ternary2 shouldHaveType ts.NULL_TYPE + spy.shouldBeOk { + ternary1 shouldHaveType java.util.Collection::class[ts.STRING] + ternary2 shouldHaveType ts.NULL_TYPE + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt index 2255c65e03..1527626869 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt @@ -21,38 +21,42 @@ import java.util.stream.Collectors class CaptureInferenceTest : ProcessorTestSpec({ parserTest("Test capture incompatibility recovery") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Archive { void something(java.util.List l) { l.set(1, l.get(0)); // captured, fails } } - """.trimIndent()) + """.trimIndent() + ) - val setCall = acu.firstMethodCall() - val getCall = setCall.arguments[1] as ASTMethodCall + val setCall = acu.firstMethodCall() + val getCall = setCall.arguments[1] as ASTMethodCall - spy.shouldHaveMissingCtDecl(setCall) + spy.shouldHaveMissingCtDecl(setCall) - acu.withTypeDsl { - val capture1 = captureMatcher(`?`) - getCall.methodType.shouldMatchMethod( + acu.withTypeDsl { + val capture1 = captureMatcher(`?`) + getCall.methodType.shouldMatchMethod( named = "get", declaredIn = gen.t_List[capture1], withFormals = listOf(int), returning = capture1 - ) + ) - setCall.methodType shouldBe ts.UNRESOLVED_METHOD + setCall.methodType shouldBe ts.UNRESOLVED_METHOD + } } } parserTest("Test lower wildcard compatibility") { + doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package java.lang; import java.util.Iterator; @@ -68,20 +72,23 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val tVar = acu.typeVar("T") - val call = acu.firstMethodCall() + val tVar = acu.typeVar("T") + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType void - call.arguments[0] shouldHaveType tVar + spy.shouldBeOk { + call shouldHaveType void + call.arguments[0] shouldHaveType tVar + } } } parserTest("Test method ref on captured thing") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; import java.util.ArrayList; import java.util.Comparator; @@ -94,39 +101,41 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("sort") { - it shouldHaveType void + spy.shouldBeOk { + call.shouldMatchN { + methodCall("sort") { + it shouldHaveType void - variableAccess("statList") {} - argList { - methodCall("comparingInt") { - // eg. java.util.Comparator + variableAccess("statList") {} + argList { + methodCall("comparingInt") { + // eg. java.util.Comparator - val captureOfString = captureMatcher(`?` extends gen.t_String) + val captureOfString = captureMatcher(`?` extends gen.t_String) - it shouldHaveType gen.t_Comparator[captureOfString] + it shouldHaveType gen.t_Comparator[captureOfString] - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = "comparingInt", declaredIn = gen.t_Comparator, withFormals = listOf(ToIntFunction::class[`?` `super` captureOfString]), returning = gen.t_Comparator[captureOfString] - ) + ) - unspecifiedChild() + unspecifiedChild() - argList { - methodRef("hashCode") { - unspecifiedChild() + argList { + methodRef("hashCode") { + unspecifiedChild() - it.referencedMethod shouldBe ts.OBJECT.getMethodsByName("hashCode").single() - it shouldHaveType ToIntFunction::class[captureOfString] + it.referencedMethod shouldBe ts.OBJECT.getMethodsByName("hashCode").single() + it shouldHaveType ToIntFunction::class[captureOfString] + } } } } @@ -137,8 +146,9 @@ class CaptureInferenceTest : ProcessorTestSpec({ } parserTest("Test independent captures merging") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.*; class Scratch { @@ -153,31 +163,34 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val tvar = acu.typeVar("T") - val call = acu.firstMethodCall() - val reqnonnull = call.arguments[0] as ASTMethodCall + val tvar = acu.typeVar("T") + val call = acu.firstMethodCall() + val reqnonnull = call.arguments[0] as ASTMethodCall - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "spliterator0", withFormals = listOf(gen.t_Collection[`?` extends tvar], int), returning = Spliterator::class[tvar] - ) + ) - val capture = captureMatcher(`?` extends tvar) - reqnonnull shouldHaveType gen.t_Collection[capture] - reqnonnull.methodType.shouldMatchMethod(named = "requireNonNull", declaredIn = Objects::class.raw) + val capture = captureMatcher(`?` extends tvar) + reqnonnull shouldHaveType gen.t_Collection[capture] + reqnonnull.methodType.shouldMatchMethod(named = "requireNonNull", declaredIn = Objects::class.raw) - reqnonnull.arguments[0] shouldHaveType gen.t_Collection[capture] + reqnonnull.arguments[0] shouldHaveType gen.t_Collection[capture] + } } } parserTest("Problem with GLB of several capture variables") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.HashMap; import java.util.Map; import java.util.function.Function; @@ -194,9 +207,10 @@ class CaptureInferenceTest : ProcessorTestSpec({ } - """.trimIndent()) + """.trimIndent() + ) - /* Signature of the other groupingBy: + /* Signature of the other groupingBy: public static > @@ -205,45 +219,46 @@ class CaptureInferenceTest : ProcessorTestSpec({ Collector downstream) */ - val (tvar, kvar, avar, dvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).first()!! + val (tvar, kvar, avar, dvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).first()!! - call.shouldMatchN { - methodCall("groupingBy") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + call.shouldMatchN { + methodCall("groupingBy") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "groupingBy", declaredIn = Collectors::class.raw, withFormals = listOf( - gen.t_Function[`?` `super` tvar, `?` extends kvar], - Supplier::class[gen.t_Map[kvar, dvar]], - Collector::class[`?` `super` tvar, avar, dvar] + gen.t_Function[`?` `super` tvar, `?` extends kvar], + Supplier::class[gen.t_Map[kvar, dvar]], + Collector::class[`?` `super` tvar, avar, dvar] ), returning = Collector::class[tvar, `?`, gen.t_Map[kvar, dvar]] - ) - } - - skipQualifier() - - argList { - variableAccess("classifier") - - constructorRef { - // HMM this should be HashMap - typeExpr { - classType("HashMap") - } + ) } - variableAccess("downstream") + skipQualifier() + + argList { + variableAccess("classifier") + + constructorRef { + // HMM this should be HashMap + typeExpr { + classType("HashMap") + } + } + + variableAccess("downstream") + } } } } } parserTest("Capture vars should be exploded in typeArgsContains") { - - /* + doTest { + /* Phase STRICT, NodeStream. union(java.lang.Iterable>) -> NodeStream Context 4, union(java.lang.Iterable>) -> NodeStream<ฮด> ARGUMENTS @@ -296,7 +311,7 @@ class CaptureInferenceTest : ProcessorTestSpec({ Possibly, this could be recursive and lead to stackoverflow? Idk */ - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.Arrays; @@ -314,19 +329,20 @@ interface NodeStream { } """.trimIndent() - ) + ) - val (_, unionOfIter) = acu.methodDeclarations().toList { it.genericSignature } + val (_, unionOfIter) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(unionOfIter) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(unionOfIter) + } } } parserTest("Ivar should be instantiated with lower not upper bound") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ interface MostlySingularMultimap { @@ -353,19 +369,20 @@ interface MostlySingularMultimap { } """.trimIndent() - ) + ) - val (_, _, lastGroupBy) = acu.methodDeclarations().toList { it.genericSignature } + val (_, _, lastGroupBy) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(lastGroupBy) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(lastGroupBy) + } } } parserTest("Unbounded wild has bound of its underlying tvar") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.List; @@ -380,17 +397,18 @@ class Scratch> { } } """.trimIndent() - ) + ) - spy.shouldBeOk { - acu.firstMethodCall().methodType + spy.shouldBeOk { + acu.firstMethodCall().methodType + } } } parserTest("Array access should be captured") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class CompletableFuture { @@ -404,30 +422,31 @@ class CompletableFuture { } """.trimIndent() - ) - - val t_CompletableFuture = acu.firstTypeSignature() - - spy.shouldBeOk { - val captureMatcher = captureMatcher(`?`) - - val arrType = acu.descendants(ASTArrayAccess::class.java).firstOrThrow().typeMirror - - arrType shouldBe t_CompletableFuture[captureMatcher] - - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "uniCopyStage", - withFormals = listOf(t_CompletableFuture[captureMatcher]), - returning = t_CompletableFuture[ts.OBJECT] ) + + val t_CompletableFuture = acu.firstTypeSignature() + + spy.shouldBeOk { + val captureMatcher = captureMatcher(`?`) + + val arrType = acu.descendants(ASTArrayAccess::class.java).firstOrThrow().typeMirror + + arrType shouldBe t_CompletableFuture[captureMatcher] + + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "uniCopyStage", + withFormals = listOf(t_CompletableFuture[captureMatcher]), + returning = t_CompletableFuture[ts.OBJECT] + ) + } } } parserTest("Capture with type annotation") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.lang.annotation.*; interface Iterator { Q next(); } interface Function { @@ -442,26 +461,27 @@ class Foo { } """.trimIndent() - ) - - val (t_Iterator, _, t_Nullable) = acu.declaredTypeSignatures() - val rvar = acu.typeVar("R") - val tvar = acu.typeVar("T") - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "apply", - withFormals = listOf(captureMatcher(`?` `super` tvar)), - returning = captureMatcher(`?` extends (`@`(t_Nullable.symbol) on t_Iterator[`?` extends rvar])) ) - acu.firstMethodCall().overloadSelectionInfo::isFailed shouldBe false + + val (t_Iterator, _, t_Nullable) = acu.declaredTypeSignatures() + val rvar = acu.typeVar("R") + val tvar = acu.typeVar("T") + + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "apply", + withFormals = listOf(captureMatcher(`?` `super` tvar)), + returning = captureMatcher(`?` extends (`@`(t_Nullable.symbol) on t_Iterator[`?` extends rvar])) + ) + acu.firstMethodCall().overloadSelectionInfo::isFailed shouldBe false + } } } parserTest("PMD crashes while using generics and wildcards #4753") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collection; import java.util.List; import java.util.Arrays; @@ -474,19 +494,20 @@ public class SubClass { } } """.trimIndent() - ) - - val tvar = acu.typeVar("T") - - spy.shouldBeOk { - val call = acu.firstMethodCall() - - call.methodType.shouldMatchMethod( - named = "addAll", - withFormals = listOf(java.util.Collection::class[`?` extends captureMatcher(`?` `super` tvar)]), - returning = boolean ) - call.overloadSelectionInfo::isFailed shouldBe false + + val tvar = acu.typeVar("T") + + spy.shouldBeOk { + val call = acu.firstMethodCall() + + call.methodType.shouldMatchMethod( + named = "addAll", + withFormals = listOf(java.util.Collection::class[`?` extends captureMatcher(`?` `super` tvar)]), + returning = boolean + ) + call.overloadSelectionInfo::isFailed shouldBe false + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt index 8719732856..e732f5febd 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt @@ -17,8 +17,8 @@ class CtorInferenceTest : ProcessorTestSpec({ parserTest("Results of diamond invoc and parameterized invoc are identical (normal classes)") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Gen { @@ -28,32 +28,34 @@ class CtorInferenceTest : ProcessorTestSpec({ g = new Gen<>(); } } - """) + """ + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (paramCall, genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (paramCall, genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - with(acu.typeDsl) { + with(acu.typeDsl) { - listOf(paramCall, genCall).forAll { call -> + listOf(paramCall, genCall).forAll { call -> - call.methodType.shouldMatchMethod( + call.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Gen[gen.t_String], withFormals = emptyList(), returning = t_Gen[gen.t_String] - ).also { - it.typeParameters shouldBe emptyList() - it.isGeneric shouldBe false + ).also { + it.typeParameters shouldBe emptyList() + it.isGeneric shouldBe false + } } } } } parserTest("Enum constant ctors") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.util.function.Function; @@ -68,40 +70,43 @@ class CtorInferenceTest : ProcessorTestSpec({ E(double c) {} E() {} } - """) + """ + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (intCtor, doubleCtor, defaultCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (intCtor, doubleCtor, defaultCtor) = acu.descendants(ASTConstructorDeclaration::class.java) + .toList { it.symbol } - val (a, b, c, d) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a, b, c, d) = acu.descendants(ASTEnumConstant::class.java).toList() - with(acu.typeDsl) { + with(acu.typeDsl) { - listOf(a, b).forAll { - it.methodType.symbol shouldBe defaultCtor - } + listOf(a, b).forAll { + it.methodType.symbol shouldBe defaultCtor + } - c.methodType.shouldMatchMethod( + c.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_E, withFormals = listOf(int), returning = t_E - ).also { it.symbol shouldBe intCtor } + ).also { it.symbol shouldBe intCtor } - d.methodType.shouldMatchMethod( + d.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_E, withFormals = listOf(double), returning = t_E - ).also { it.symbol shouldBe doubleCtor } + ).also { it.symbol shouldBe doubleCtor } + } } } parserTest("Generic enum constant ctors") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.function.Function; @@ -113,52 +118,57 @@ class CtorInferenceTest : ProcessorTestSpec({ E(double c, double k) {} E(T c, Function fun) {} } - """) + """ + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (_, _, genericCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, genericCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } - val (a) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a) = acu.descendants(ASTEnumConstant::class.java).toList() - spy.shouldBeOk { + spy.shouldBeOk { - a.methodType.shouldMatchMethod( + a.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_E, - withFormals = listOf(double.box(), gen.t_Function[`?` `super` double.box(), `?` extends double.box()]), + withFormals = listOf( + double.box(), + gen.t_Function[`?` `super` double.box(), `?` extends double.box()] + ), returning = t_E - ).also { it.symbol shouldBe genericCtor } + ).also { it.symbol shouldBe genericCtor } + } } - } parserTest("Anonymous enum ctor") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.util.function.Function; enum E { A { } } - """) + """ + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (a) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a) = acu.descendants(ASTEnumConstant::class.java).toList() - a.methodType.shouldMatchMethod( + a.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_E, withFormals = emptyList(), returning = t_E // not the anonymous type - ) - + ) + } } parserTest("Generic superclass ctor") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Sup { @@ -171,31 +181,32 @@ class CtorInferenceTest : ProcessorTestSpec({ } } - """) + """ + ) - val (t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (supCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + val (supCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - with (ctor.typeDsl) { - ctor.methodType.shouldMatchMethod( + with(ctor.typeDsl) { + ctor.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Sup[ts.STRING], withFormals = listOf(ts.STRING, ts.STRING), returning = t_Sup[ts.STRING] // the superclass type - ).also { - it.symbol shouldBe supCtor.symbol - it.symbol.tryGetNode() shouldBe supCtor + ).also { + it.symbol shouldBe supCtor.symbol + it.symbol.tryGetNode() shouldBe supCtor + } } } - } parserTest("Qualified superclass ctor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ @@ -213,31 +224,33 @@ class CtorInferenceTest : ProcessorTestSpec({ } } - """) + """ + ) - val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() - val (innerCtor) = acu.ctorDeclarations().toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + val (innerCtor) = acu.ctorDeclarations().toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - spy.shouldBeOk { - ctor.methodType.shouldMatchMethod( + spy.shouldBeOk { + ctor.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Outer select t_Inner[ts.STRING], withFormals = listOf(ts.STRING), returning = t_Outer select t_Inner[ts.STRING] - ) + ) - ctor.methodType.let { - it.symbol shouldBe innerCtor.symbol - it.symbol.tryGetNode() shouldBe innerCtor + ctor.methodType.let { + it.symbol shouldBe innerCtor.symbol + it.symbol.tryGetNode() shouldBe innerCtor + } } } } parserTest("Qualified generic superclass ctor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ @@ -257,59 +270,63 @@ class CtorInferenceTest : ProcessorTestSpec({ } } - """) + """ + ) - val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() - val (innerCtor) = acu.ctorDeclarations().toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + val (innerCtor) = acu.ctorDeclarations().toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - spy.shouldBeOk { - ctor.methodType.shouldMatchMethod( + spy.shouldBeOk { + ctor.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = t_Outer[ts.INT.box()] select t_Inner, withFormals = listOf(ts.INT.box()), returning = t_Outer[ts.INT.box()] select t_Inner - ) + ) - ctor.methodType.let { - it.symbol shouldBe innerCtor.symbol - it.symbol.tryGetNode() shouldBe innerCtor + ctor.methodType.let { + it.symbol shouldBe innerCtor.symbol + it.symbol.tryGetNode() shouldBe innerCtor + } } } } parserTest("Unresolved enclosing type for inner class ctor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch {{ someUnresolvedQualifier().new Inner(); }} - """) + """ + ) - val (ctor) = acu.ctorCalls().toList() + val (ctor) = acu.ctorCalls().toList() - spy.shouldBeOk { - ctor.qualifier!!.shouldHaveType(ts.UNKNOWN) - ctor.typeNode.simpleName shouldBe "Inner" - ctor.typeNode.typeMirror.shouldBeSameInstanceAs(ctor.typeMirror) - ctor.typeNode shouldHaveType ts.UNKNOWN - // if we ever switch to creating a fake symbol - // .typeMirror.shouldBeA { - // it.symbol.isUnresolved shouldBe true - // it.symbol.simpleName shouldBe "Inner" - // } + spy.shouldBeOk { + ctor.qualifier!!.shouldHaveType(ts.UNKNOWN) + ctor.typeNode.simpleName shouldBe "Inner" + ctor.typeNode.typeMirror.shouldBeSameInstanceAs(ctor.typeMirror) + ctor.typeNode shouldHaveType ts.UNKNOWN + // if we ever switch to creating a fake symbol + // .typeMirror.shouldBeA { + // it.symbol.isUnresolved shouldBe true + // it.symbol.simpleName shouldBe "Inner" + // } - ctor.methodType.shouldBe(ts.UNRESOLVED_METHOD) + ctor.methodType.shouldBe(ts.UNRESOLVED_METHOD) + } } } parserTest("Failed overload resolution of context doesn't let types dangle") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ public class Generic { static class Inner {} @@ -319,24 +336,25 @@ class CtorInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (_, inner) = acu.declaredTypeSignatures() - val enclosingMethodCall = acu.firstMethodCall() - val ctorCall = acu.firstCtorCall() - val ctorSymbol = inner.constructors.first().symbol + val (_, inner) = acu.declaredTypeSignatures() + val enclosingMethodCall = acu.firstMethodCall() + val ctorCall = acu.firstCtorCall() + val ctorSymbol = inner.constructors.first().symbol - spy.shouldHaveMissingCtDecl(enclosingMethodCall) + spy.shouldHaveMissingCtDecl(enclosingMethodCall) - ctorCall.withTypeDsl { // for the enclosing method call - ctorCall.methodType.symbol shouldBe ctorSymbol + ctorCall.withTypeDsl { // for the enclosing method call + ctorCall.methodType.symbol shouldBe ctorSymbol + } } } parserTest("Mapping of type params doesn't fail") { - - val (acu, _) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(Class c, E inst) {} @@ -348,14 +366,15 @@ class CtorInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.declaredTypeSignatures() - val ctorCall = acu.firstCtorCall() - val ctorSymbol = t_Gen.constructors.first().symbol + val (t_Gen) = acu.declaredTypeSignatures() + val ctorCall = acu.firstCtorCall() + val ctorSymbol = t_Gen.constructors.first().symbol - ctorCall.withTypeDsl { // for the enclosing method call - ctorCall.methodType.symbol shouldBe ctorSymbol + ctorCall.withTypeDsl { // for the enclosing method call + ctorCall.methodType.symbol shouldBe ctorSymbol + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt index 85e44cbd22..eb341d4249 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt @@ -19,9 +19,9 @@ class ExplicitTypesTest : ProcessorTestSpec({ parserTest("Test explicit type arguments") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collection; @@ -34,20 +34,21 @@ class ExplicitTypesTest : ProcessorTestSpec({ } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType ts.NO_TYPE - call.arguments[0].shouldBeA { - it.methodType.shouldMatchMethod( - named = "emptyList", - declaredIn = Collections::class.decl, - withFormals = emptyList(), - returning = gen.`t_List{String}` - ) + spy.shouldBeOk { + call shouldHaveType ts.NO_TYPE + call.arguments[0].shouldBeA { + it.methodType.shouldMatchMethod( + named = "emptyList", + declaredIn = Collections::class.decl, + withFormals = emptyList(), + returning = gen.`t_List{String}` + ) + } } } } @@ -55,8 +56,9 @@ class ExplicitTypesTest : ProcessorTestSpec({ parserTest("Explicitly typed lambda") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Function { V apply(U u); @@ -73,23 +75,26 @@ class NodeStream { } } - """) + """ + ) - val (t_Function, _, _, t_Foo) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val call = acu.firstMethodCall() + val (t_Function, _, _, t_Foo) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val call = acu.firstMethodCall() - spy.shouldBeOk { - lambda shouldHaveType t_Function[t_Foo, t_Foo] - call.overloadSelectionInfo.isFailed shouldBe false + spy.shouldBeOk { + lambda shouldHaveType t_Function[t_Foo, t_Foo] + call.overloadSelectionInfo.isFailed shouldBe false + } } } parserTest("Explicitly typed lambda with wildcard") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Number {} interface Integer extends Number {} @@ -102,13 +107,15 @@ class NodeStream { } } - """) + """ + ) - val (t_Number, _, t_Predicate) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (t_Number, _, t_Predicate) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - spy.shouldBeOk { - lambda shouldHaveType t_Predicate[t_Number] + spy.shouldBeOk { + lambda shouldHaveType t_Predicate[t_Number] + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt index d95b755b30..9284aa4221 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt @@ -16,9 +16,9 @@ class Java7InferenceTest : ProcessorTestSpec({ parserTest("Java 7 uses return constraints only if args are not enough", javaVersion = J1_7) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(T t) {} static { @@ -27,21 +27,22 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - // inferred to Gen> on java 7 - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[gen.t_String]]) + spy.shouldBeOk { + // inferred to Gen> on java 7 + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[gen.t_String]]) + } } } parserTest("Same test in java 8", javaVersion = J1_8) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(T t) {} static { @@ -50,22 +51,23 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) + spy.shouldBeOk { + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) + } } } parserTest("Java 7 uses return constraints if needed", javaVersion = J1_7) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { static { // inferred to Gen> @@ -73,22 +75,23 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) + spy.shouldBeOk { + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) + } } } parserTest("Java 7 doesn't let context flow through ternary", javaVersion = J1_7) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { public void test() { final Sup l2; @@ -99,28 +102,29 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (conditional) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (conditional) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - // no context + spy.shouldBeOk { + // no context - conditional.thenBranch.conversionContext::isMissing shouldBe true - conditional.thenBranch shouldHaveType t_Gen[ts.OBJECT] - conditional.elseBranch shouldHaveType t_Gen[ts.OBJECT] + conditional.thenBranch.conversionContext::isMissing shouldBe true + conditional.thenBranch shouldHaveType t_Gen[ts.OBJECT] + conditional.elseBranch shouldHaveType t_Gen[ts.OBJECT] - // and Gen on java 8 - conditional shouldHaveType t_Gen[ts.OBJECT] + // and Gen on java 8 + conditional shouldHaveType t_Gen[ts.OBJECT] + } } } parserTest("Java 7 doesn't use invocation context", javaVersion = J1_7) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { Gen(T t) {} Gen() {} @@ -134,30 +138,31 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() - val (genM1, genM2, genM3) = acu.methodCalls().toList() + val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() + val (genM1, genM2, genM3) = acu.methodCalls().toList() - spy.shouldBeOk { - // no context + spy.shouldBeOk { + // no context - ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) - ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) - ctorInfersTo(genString, t_Gen[ts.STRING]) + ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) + ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) + ctorInfersTo(genString, t_Gen[ts.STRING]) - methodInfersTo(genM1, t_Sup[ts.OBJECT]) - methodInfersTo(genM2, t_Sup[ts.STRING]) - methodInfersTo(genM3, t_Sup[ts.STRING]) + methodInfersTo(genM1, t_Sup[ts.OBJECT]) + methodInfersTo(genM2, t_Sup[ts.STRING]) + methodInfersTo(genM3, t_Sup[ts.STRING]) + } } } parserTest("Java 7 doesn't use invocation context (2)", javaVersion = J1_7) { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { Gen(T t) {} Gen() {} @@ -171,22 +176,23 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() - val (genM1, genM2, genM3) = acu.methodCalls().toList() + val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() + val (genM1, genM2, genM3) = acu.methodCalls().toList() - spy.shouldBeOk { - // tests methods before ctors - methodInfersTo(genM1, t_Sup[ts.OBJECT]) - methodInfersTo(genM2, t_Sup[ts.STRING]) - methodInfersTo(genM3, t_Sup[ts.STRING]) + spy.shouldBeOk { + // tests methods before ctors + methodInfersTo(genM1, t_Sup[ts.OBJECT]) + methodInfersTo(genM2, t_Sup[ts.STRING]) + methodInfersTo(genM3, t_Sup[ts.STRING]) - ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) - ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) - ctorInfersTo(genString, t_Gen[ts.STRING]) + ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) + ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) + ctorInfersTo(genString, t_Gen[ts.STRING]) + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt index 934ba6e60f..449873076a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt @@ -25,7 +25,6 @@ class LambdaInferenceTest : ProcessorTestSpec({ parserTest("Test dangling method parameter - ok") { - importedTypes += java.util.List::class.java importedTypes += TypeInferenceTestCases::class.java genClassHeader = "class TypeInferenceTestCases" @@ -41,42 +40,41 @@ class LambdaInferenceTest : ProcessorTestSpec({ """ + inContext(ExpressionParsingCtx) { + chain should parseAs { + methodCall("collect") { + it shouldHaveType with(it.typeDsl) { gen.t_List[int.box()] } // List - val node = ExpressionParsingCtx.parseNode(chain, this) - - node.shouldMatchN { - methodCall("collect") { - it shouldHaveType with(it.typeDsl) { gen.t_List[int.box()] } // List - - it::getQualifier shouldBe methodCall("peek") { - it shouldHaveType with(it.typeDsl) { gen.t_Stream[int.box()] } // Stream - - it::getQualifier shouldBe methodCall("of") { + it::getQualifier shouldBe methodCall("peek") { it shouldHaveType with(it.typeDsl) { gen.t_Stream[int.box()] } // Stream - it::getQualifier shouldBe typeExpr { - qualClassType("java.util.stream.Stream") + + it::getQualifier shouldBe methodCall("of") { + it shouldHaveType with(it.typeDsl) { gen.t_Stream[int.box()] } // Stream + it::getQualifier shouldBe typeExpr { + qualClassType("java.util.stream.Stream") + } + + it::getArguments shouldBe child { + int(1) + } } it::getArguments shouldBe child { - int(1) - } - } - it::getArguments shouldBe child { + child { + unspecifiedChild() // params - child { - unspecifiedChild() // params - - methodCall("wild") { - argList { - variableAccess("i") + methodCall("wild") { + argList { + variableAccess("i") + } } } } } - } - it::getArguments shouldBe child { - unspecifiedChild() + it::getArguments shouldBe child { + unspecifiedChild() + } } } } @@ -101,49 +99,50 @@ class LambdaInferenceTest : ProcessorTestSpec({ """ - val node = ExpressionParsingCtx.parseNode(chain, this) + inContext(ExpressionParsingCtx) { + chain should parseAs { + methodCall("collect") { + it shouldHaveType with(it.typeDsl) { gen.t_List[ts.UNKNOWN] } // List - node.shouldMatchN { - methodCall("collect") { - it shouldHaveType with(it.typeDsl) { gen.t_List[ts.UNKNOWN] } // List + it::getQualifier shouldBe methodCall("map") { + it shouldHaveType with(it.typeDsl) { gen.t_Stream[ts.UNKNOWN] } // Stream - it::getQualifier shouldBe methodCall("map") { - it shouldHaveType with(it.typeDsl) { gen.t_Stream[ts.UNKNOWN] } // Stream + it::getQualifier shouldBe methodCall("of") { + it shouldHaveType with(it.typeDsl) { gen.t_Stream[int.box()] } // Stream + it::getQualifier shouldBe typeExpr { + qualClassType("java.util.stream.Stream") + } - it::getQualifier shouldBe methodCall("of") { - it shouldHaveType with(it.typeDsl) { gen.t_Stream[int.box()] } // Stream - it::getQualifier shouldBe typeExpr { - qualClassType("java.util.stream.Stream") + it::getArguments shouldBe child { + int(1) + } } it::getArguments shouldBe child { - int(1) - } - } - it::getArguments shouldBe child { + child { + unspecifiedChild() // params - child { - unspecifiedChild() // params - - methodCall("wild") { - argList { - variableAccess("i") + methodCall("wild") { + argList { + variableAccess("i") + } } } } } - } - it::getArguments shouldBe child { - unspecifiedChild() + it::getArguments shouldBe child { + unspecifiedChild() + } } } } } parserTest("Test functional interface induced by intersection") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.io.Serializable; import java.util.function.Function; @@ -158,31 +157,38 @@ class LambdaInferenceTest : ProcessorTestSpec({ f(s -> s.length()); } } - """) + """ + ) - val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() - fCall.shouldMatchN { - methodCall("f") { - it.methodType.symbol shouldBe f.symbol + fCall.shouldMatchN { + methodCall("f") { + it.methodType.symbol shouldBe f.symbol - with(it.typeDsl) { - // Function & java.io.Serializable - val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE + with(it.typeDsl) { + // Function & java.io.Serializable + val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE - it.methodType.shouldMatchMethod(named = "f", declaredIn = t_Scratch, withFormals = listOf(serialFun), returning = serialFun) - } + it.methodType.shouldMatchMethod( + named = "f", + declaredIn = t_Scratch, + withFormals = listOf(serialFun), + returning = serialFun + ) + } - argList { - exprLambda { - lambdaFormals(1) - methodCall("length") { - variableAccess("s") { - it shouldHaveType it.typeSystem.STRING + argList { + exprLambda { + lambdaFormals(1) + methodCall("length") { + variableAccess("s") { + it shouldHaveType it.typeSystem.STRING + } + argList(0) } - argList(0) } } } @@ -192,7 +198,9 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Test functional interface induced by intersection 2") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.io.Serializable; import java.util.function.Function; @@ -208,31 +216,38 @@ class LambdaInferenceTest : ProcessorTestSpec({ f(s -> s.length()); } } - """) + """ + ) - val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() - fCall.shouldMatchN { - methodCall("f") { - it.methodType.symbol shouldBe f.symbol + fCall.shouldMatchN { + methodCall("f") { + it.methodType.symbol shouldBe f.symbol - with(it.typeDsl) { - // Function & java.io.Serializable - val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE + with(it.typeDsl) { + // Function & java.io.Serializable + val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE - it.methodType.shouldMatchMethod(named = "f", declaredIn = t_Scratch, withFormals = listOf(serialFun), returning = serialFun) - } + it.methodType.shouldMatchMethod( + named = "f", + declaredIn = t_Scratch, + withFormals = listOf(serialFun), + returning = serialFun + ) + } - argList { - exprLambda { - lambdaFormals(1) - methodCall("length") { - variableAccess("s") { - it shouldHaveType it.typeSystem.STRING + argList { + exprLambda { + lambdaFormals(1) + methodCall("length") { + variableAccess("s") { + it shouldHaveType it.typeSystem.STRING + } + argList(0) } - argList(0) } } } @@ -241,7 +256,9 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Test lambda with field access in return expression (inner ctor call)") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.function.Function; class Scratch { @@ -260,39 +277,43 @@ class LambdaInferenceTest : ProcessorTestSpec({ foo(s -> s.new WithField().i); } } - """) + """ + ) - val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() - fooCall.shouldMatchN { - methodCall("foo") { - argList { - exprLambda { - lambdaFormals(1) + fooCall.shouldMatchN { + methodCall("foo") { + argList { + exprLambda { + lambdaFormals(1) - fieldAccess("i") { - it shouldHaveType it.typeSystem.INT - constructorCall { - variableAccess("s") { - it shouldHaveType t_Scratch + fieldAccess("i") { + it shouldHaveType it.typeSystem.INT + constructorCall { + variableAccess("s") { + it shouldHaveType t_Scratch + } + classType("WithField") { + it shouldHaveType t_WithField + } + argList(0) } - classType("WithField") { - it shouldHaveType t_WithField - } - argList(0) } } } + it.methodType.symbol shouldBe foo.symbol // ask after asking for type of inner } - it.methodType.symbol shouldBe foo.symbol // ask after asking for type of inner } } } parserTest("Test lambda with field access in return expression (method call)") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.function.Function; class Scratch { @@ -313,26 +334,28 @@ class LambdaInferenceTest : ProcessorTestSpec({ foo(s -> s.fetch().i); } } - """) + """ + ) - val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (fetch, foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (fetch, foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() - fooCall.shouldMatchN { - methodCall("foo") { - it.methodType.symbol shouldBe foo.symbol - argList { - exprLambda { - lambdaFormals(1) + fooCall.shouldMatchN { + methodCall("foo") { + it.methodType.symbol shouldBe foo.symbol + argList { + exprLambda { + lambdaFormals(1) - fieldAccess("i") { - it shouldHaveType it.typeSystem.INT - methodCall("fetch") { - variableAccess("s") { - it shouldHaveType t_Scratch + fieldAccess("i") { + it shouldHaveType it.typeSystem.INT + methodCall("fetch") { + variableAccess("s") { + it shouldHaveType t_Scratch + } + argList(0) } - argList(0) } } } @@ -342,8 +365,9 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Method invocation selection in lambda return") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { interface Foo { @@ -363,31 +387,33 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ctx") { + call.shouldMatchN { + methodCall("ctx") { - argList { - exprLambda { - lambdaFormals(1) - methodCall("fetch") { - variableAccess("g") + argList { + exprLambda { + lambdaFormals(1) + methodCall("fetch") { + variableAccess("g") - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "fetch", declaredIn = t_G[gen.t_String], withFormals = emptyList(), returning = gen.t_String - ) - } + ) + } - argList(0) + argList(0) + } } } } @@ -397,8 +423,9 @@ class Scratch { parserTest("Block lambda") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { interface Foo { @@ -418,33 +445,35 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ctx") { + call.shouldMatchN { + methodCall("ctx") { - argList { - blockLambda { - lambdaFormals(1) - block { - returnStatement { - methodCall("fetch") { - variableAccess("g") + argList { + blockLambda { + lambdaFormals(1) + block { + returnStatement { + methodCall("fetch") { + variableAccess("g") - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "fetch", declaredIn = t_G[gen.t_String], withFormals = emptyList(), returning = gen.t_String - ) - } + ) + } - argList(0) + argList(0) + } } } } @@ -456,8 +485,9 @@ class Scratch { parserTest("Value compatibility unit tests") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { static { @@ -471,69 +501,78 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val infer = Infer(testTypeSystem, 8, TypeInferenceLogger.noop()) - val mirrors = JavaExprMirrors.forTypeResolution(infer) - val (a, b, c, d, e, f, h) = acu.descendants(ASTLambdaExpression::class.java).toList { mirrors.getTopLevelFunctionalMirror(it) as ExprMirror.LambdaExprMirror } + val infer = Infer(testTypeSystem, 8, TypeInferenceLogger.noop()) + val mirrors = JavaExprMirrors.forTypeResolution(infer) + val (a, b, c, d, e, f, h) = acu.descendants(ASTLambdaExpression::class.java) + .toList { mirrors.getTopLevelFunctionalMirror(it) as ExprMirror.LambdaExprMirror } - fun ExprMirror.LambdaExprMirror.shouldBeCompat(void: Boolean = false, value: Boolean = false) { - withClue(this) { - assertEquals(void, this.isVoidCompatible, "void compatible") - assertEquals(value, this.isValueCompatible, "value compatible") + fun ExprMirror.LambdaExprMirror.shouldBeCompat(void: Boolean = false, value: Boolean = false) { + withClue(this) { + assertEquals(void, this.isVoidCompatible, "void compatible") + assertEquals(value, this.isValueCompatible, "value compatible") + } } + + + a.shouldBeCompat(value = true) + b.shouldBeCompat(void = true) + c.shouldBeCompat(void = true) + d.shouldBeCompat(value = true) + e.shouldBeCompat(value = true, void = true) + f.shouldBeCompat(value = true, void = true) + h.shouldBeCompat(value = true, void = true) } - - - a.shouldBeCompat(value = true) - b.shouldBeCompat(void = true) - c.shouldBeCompat(void = true) - d.shouldBeCompat(value = true) - e.shouldBeCompat(value = true, void = true) - f.shouldBeCompat(value = true, void = true) - h.shouldBeCompat(value = true, void = true) - } parserTest("Test void compatible lambda with value compatible body") { + doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ final Runnable pr = 0 == null ? null : () -> id(true); }} - """.trimIndent()) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType java.lang.Runnable::class.raw + spy.shouldBeOk { + lambda shouldHaveType java.lang.Runnable::class.raw + } } } parserTest("Test void compatible lambda with void body") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.DoubleConsumer; class Foo { protected DoubleConsumer emptyConsumer() { return e -> {}; } } - """.trimIndent()) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType DoubleConsumer::class.raw + spy.shouldBeOk { + lambda shouldHaveType DoubleConsumer::class.raw + } } } parserTest("Test early solved functional interface") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.DoubleConsumer; import java.util.List; class Foo { @@ -545,20 +584,24 @@ class Scratch { ok(singletonList(d -> { })); } } - """.trimIndent()) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType DoubleConsumer::class.raw + spy.shouldBeOk { + lambda shouldHaveType DoubleConsumer::class.raw + } } } parserTest("Test explicitly typed lambda with zero params, ground-target type inference") { - // note that this is not actually implemented, we just special-case the case "zero parameters" - // this is todo for future, doesn't appear too useful + doTest { + // note that this is not actually implemented, we just special-case the case "zero parameters" + // this is todo for future, doesn't appear too useful - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.Supplier; class Foo { @@ -567,18 +610,21 @@ class Scratch { public static final Foo FILENAME = Foo.withInitial(() -> "/*unknown*/"); } - """.trimIndent()) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType Supplier::class[gen.t_String] + spy.shouldBeOk { + lambda shouldHaveType Supplier::class[gen.t_String] + } } } parserTest("Nested lambda param resolution (in to out)") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Foreachable { @@ -594,22 +640,25 @@ class Scratch { } } - """) + """ + ) - val (t_Foreachable, t_Action) = acu.declaredTypeSignatures() - val (action, f1, f2) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - val evar = acu.typeVar("E") + val (t_Foreachable, t_Action) = acu.declaredTypeSignatures() + val (action, f1, f2) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() + val evar = acu.typeVar("E") - spy.shouldBeOk { - f2 shouldHaveType evar - f1 shouldHaveType t_Foreachable[evar] - action shouldHaveType t_Action[`?` `super` evar] + spy.shouldBeOk { + f2 shouldHaveType evar + f1 shouldHaveType t_Foreachable[evar] + action shouldHaveType t_Action[`?` `super` evar] + } } } parserTest("Nested lambda param resolution, when there are several overloads to give ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Runnable { void run(); } interface Supplier { E get(); } @@ -625,25 +674,25 @@ class Scratch { bench("label", () -> foreachable.foreach(s -> s.toString())); } } - + """ + ) - - """) + val (t_Runnable, t_Supplier, t_Action, t_Foreachable) = acu.declaredTypeSignatures() + val (run, action) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (s) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - val (t_Runnable, t_Supplier, t_Action, t_Foreachable) = acu.declaredTypeSignatures() - val (run, action) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (s) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - - spy.shouldBeOk { - run shouldHaveType t_Runnable - action shouldHaveType t_Action[gen.t_String] - s shouldHaveType gen.t_String + spy.shouldBeOk { + run shouldHaveType t_Runnable + action shouldHaveType t_Action[gen.t_String] + s shouldHaveType gen.t_String + } } } parserTest("Body expression should be ground") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Iterator {} interface Function { @@ -661,22 +710,27 @@ class NodeStream { public static Iterator mapNotNull(Iterator it, Function mapper) { return null; } } - """) + """ + ) - val (t_Iterator, t_Function, t_NodeStream) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (iter) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - val (_, _, _, tvar, rvar) = acu.typeVariables() + val (t_Iterator, t_Function, t_NodeStream) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (iter) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() + val (_, _, _, tvar, rvar) = acu.typeVariables() - spy.shouldBeOk { - lambda shouldHaveType t_Function[t_Iterator[tvar], t_Iterator[rvar]] - iter shouldHaveType t_Iterator[tvar] - lambda.expressionBody!!.shouldBeA { - it.methodType.shouldMatchMethod( + spy.shouldBeOk { + lambda shouldHaveType t_Function[t_Iterator[tvar], t_Iterator[rvar]] + iter shouldHaveType t_Iterator[tvar] + lambda.expressionBody!!.shouldBeA { + it.methodType.shouldMatchMethod( named = "mapNotNull", - withFormals = listOf(t_Iterator[`?` extends tvar], t_Function[`?` `super` tvar, `?` extends rvar]) - ) - it shouldHaveType t_Iterator[rvar] + withFormals = listOf( + t_Iterator[`?` extends tvar], + t_Function[`?` `super` tvar, `?` extends rvar] + ) + ) + it shouldHaveType t_Iterator[rvar] + } } } } @@ -731,8 +785,9 @@ class NodeStream { parserTest("inference of call within lambda fails") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Iterator {} interface Function { @@ -749,20 +804,22 @@ class NodeStream { } } - """) + """ + ) - val (t_Iterator, t_Function, t_Iterable) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (_, _, _, _, tvar, rvar) = acu.typeVariables() + val (t_Iterator, t_Function, t_Iterable) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (_, _, _, _, tvar, rvar) = acu.typeVariables() - spy.shouldBeOk { - lambda shouldHaveType t_Iterable[rvar] - lambda.expressionBody!!.shouldBeA { - it.methodType.shouldMatchMethod( - named = "apply", - withFormals = listOf(captureMatcher(`?` `super` t_Iterator[`?` extends tvar])) - ) - it.overloadSelectionInfo::isFailed shouldBe false + spy.shouldBeOk { + lambda shouldHaveType t_Iterable[rvar] + lambda.expressionBody!!.shouldBeA { + it.methodType.shouldMatchMethod( + named = "apply", + withFormals = listOf(captureMatcher(`?` `super` t_Iterator[`?` extends tvar])) + ) + it.overloadSelectionInfo::isFailed shouldBe false + } } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt index 46c240cb8e..87fb71ae61 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt @@ -15,54 +15,60 @@ import net.sourceforge.pmd.lang.java.types.* class LocalVarInferenceTest : ProcessorTestSpec({ parserTest("Test for var inference projection") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static void take5(Iterable iter) { for (var entry : iter) { } // entry is projected to `T`, not `? extends T` } } - """.trimIndent()) + """.trimIndent() + ) - val tvar = acu.typeVariables()[0] - val entryId = acu.varId("entry") - val iterAccess = acu.varAccesses("iter")[0]!! + val tvar = acu.typeVariables()[0] + val entryId = acu.varId("entry") + val iterAccess = acu.varAccesses("iter")[0]!! - spy.shouldBeOk { - entryId shouldHaveType tvar // not ? extends T - iterAccess shouldHaveType gen.t_Iterable[captureMatcher(`?` extends tvar)] + spy.shouldBeOk { + entryId shouldHaveType tvar // not ? extends T + iterAccess shouldHaveType gen.t_Iterable[captureMatcher(`?` extends tvar)] + } } } parserTest("Test local var inference") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ var map = new java.util.HashMap(((4 * convCount) / 3) + 1); for (var entry : map.entrySet()) { int[] positions = entry.getValue(); } }} - """) + """ + ) - val (entrySet, getValue) = acu.methodCalls().toList() + val (entrySet, getValue) = acu.methodCalls().toList() - spy.shouldBeOk { - val entryType = java.util.Map.Entry::class[ts.OBJECT, int.toArray()] - entrySet shouldHaveType java.util.Set::class[entryType] - getValue shouldHaveType int.toArray() - getValue.qualifier!!.shouldMatchN { - variableAccess("entry") { - it shouldHaveType entryType + spy.shouldBeOk { + val entryType = java.util.Map.Entry::class[ts.OBJECT, int.toArray()] + entrySet shouldHaveType java.util.Set::class[entryType] + getValue shouldHaveType int.toArray() + getValue.qualifier!!.shouldMatchN { + variableAccess("entry") { + it shouldHaveType entryType + } } } } } parserTest("Unbounded wild is projected to upper bound of its underlying tvar") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch> { @@ -76,18 +82,19 @@ class Scratch> { } } """.trimIndent() - ) + ) - val t_Scratch = acu.firstTypeSignature() + val t_Scratch = acu.firstTypeSignature() - spy.shouldBeOk { - acu.varId("k") shouldHaveType t_Scratch[`?` extends t_Scratch[`?`]] + spy.shouldBeOk { + acu.varId("k") shouldHaveType t_Scratch[`?` extends t_Scratch[`?`]] + } } } parserTest("Local var for anonymous") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch { @@ -96,11 +103,12 @@ class Scratch { } } """.trimIndent() - ) + ) - spy.shouldBeOk { - // not the anon type - acu.varId("k") shouldHaveType Runnable::class.decl + spy.shouldBeOk { + // not the anon type + acu.varId("k") shouldHaveType Runnable::class.decl + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt index 70ca35ff47..eec91dbef5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt @@ -21,8 +21,9 @@ class MethodRefInferenceTest : ProcessorTestSpec({ parserTest("Test inexact method ref of generic type") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.Optional; import java.util.List; import java.util.stream.Stream; @@ -35,30 +36,34 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val t_Archive = acu.descendants(ASTClassDeclaration::class.java).firstOrThrow().typeMirror - val anyMatch = acu.descendants(ASTMethodCall::class.java).first()!! + val t_Archive = acu.descendants(ASTClassDeclaration::class.java).firstOrThrow().typeMirror + val anyMatch = acu.descendants(ASTMethodCall::class.java).first()!! - anyMatch.shouldMatchN { - methodCall("anyMatch") { - it shouldHaveType it.typeSystem.BOOLEAN + anyMatch.shouldMatchN { + methodCall("anyMatch") { + it shouldHaveType it.typeSystem.BOOLEAN - methodCall("filter") { - - it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } - - methodCall("flatMap") { + methodCall("filter") { it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } - methodCall("of") { - skipQualifier() + methodCall("flatMap") { - it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_List[t_Archive]] } + it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } - argList(3) + methodCall("of") { + skipQualifier() + + it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_List[t_Archive]] } + + argList(3) + } + + argList(1) } argList(1) @@ -66,8 +71,6 @@ class MethodRefInferenceTest : ProcessorTestSpec({ argList(1) } - - argList(1) } } } @@ -335,8 +338,9 @@ class MethodRefInferenceTest : ProcessorTestSpec({ parserTest("Test failing method ref with this as LHS") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package scratch; @@ -351,28 +355,31 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val t_Archive = acu.firstTypeSignature() - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - val call = acu.firstMethodCall() + val t_Archive = acu.firstTypeSignature() + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() + val call = acu.firstMethodCall() - spy.shouldHaveMissingCtDecl(call) + spy.shouldHaveMissingCtDecl(call) - acu.withTypeDsl { - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD - mref shouldHaveType ts.UNKNOWN - call.methodType shouldBe ts.UNRESOLVED_METHOD - call.overloadSelectionInfo.apply { - isFailed shouldBe true + acu.withTypeDsl { + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + mref shouldHaveType ts.UNKNOWN + call.methodType shouldBe ts.UNRESOLVED_METHOD + call.overloadSelectionInfo.apply { + isFailed shouldBe true + } } } } parserTest("Test method ref with void return type") { + doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Optional; class Archive { @@ -381,30 +388,32 @@ class MethodRefInferenceTest : ProcessorTestSpec({ return "foo"; } } - """.trimIndent()) + """.trimIndent() + ) - val t_Archive = acu.firstTypeSignature() - val getName = acu.methodDeclarations().firstOrThrow() - val ifPresentCall = acu.firstMethodCall() + val t_Archive = acu.firstTypeSignature() + val getName = acu.methodDeclarations().firstOrThrow() + val ifPresentCall = acu.firstMethodCall() - spy.shouldBeOk { - ifPresentCall.shouldMatchN { - methodCall("ifPresent") { - unspecifiedChild() - argList { - methodRef("getName") { - it.functionalMethod.shouldMatchMethod( + spy.shouldBeOk { + ifPresentCall.shouldMatchN { + methodCall("ifPresent") { + unspecifiedChild() + argList { + methodRef("getName") { + it.functionalMethod.shouldMatchMethod( named = "accept", declaredIn = Consumer::class[t_Archive], withFormals = listOf(t_Archive), returning = ts.NO_TYPE - ) + ) - it.referencedMethod.symbol shouldBe getName.symbol + it.referencedMethod.symbol shouldBe getName.symbol - typeExpr { - classType("Archive") + typeExpr { + classType("Archive") + } } } } @@ -416,8 +425,9 @@ class MethodRefInferenceTest : ProcessorTestSpec({ // disabled for now parserTest("Test inference var inst substitution in enclosing ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collections; import java.util.Iterator; import java.util.function.Function; @@ -438,36 +448,39 @@ abstract class NodeStream implements Iterable { protected abstract NodeStream mapIter(Function, Iterator> fun); } - """.trimIndent()) + """.trimIndent() + ) - val (t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (tvar, rvar, kvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val (t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (tvar, rvar, kvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.t_Function[captureMatcher(`?` `super` tvar), gen.t_Iterator[`?` extends rvar]] - call.arguments[0].shouldMatchN { - methodRef("safeMap") { - with(it.typeDsl) { - // safeMap#K must have been instantiated to some variation of R - it.referencedMethod.shouldMatchMethod( + spy.shouldBeOk { + call shouldHaveType gen.t_Function[captureMatcher(`?` `super` tvar), gen.t_Iterator[`?` extends rvar]] + call.arguments[0].shouldMatchN { + methodRef("safeMap") { + with(it.typeDsl) { + // safeMap#K must have been instantiated to some variation of R + it.referencedMethod.shouldMatchMethod( named = "safeMap", declaredIn = t_NodeStream.erasure, withFormals = listOf(t_NodeStream[`?` extends rvar]), returning = gen.t_Iterator[captureMatcher(`?` extends rvar)] - ) - } + ) + } - skipQualifier() + skipQualifier() + } } } } } parserTest("Fix method ref non-wildcard parameterization not being ground in listener") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import static java.util.stream.Collectors.collectingAndThen; import static java.util.stream.Collectors.toList; @@ -484,37 +497,40 @@ class Scratch { .collect(collectingAndThen(toList(), Collections::unmodifiableList)); } } - """.trimIndent()) + """.trimIndent() + ) - val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! + val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! - collectCall.shouldMatchN { - methodCall("collect") { - with(it.typeDsl) { - it shouldHaveType gen.`t_List{String}` - } - - methodCall("distinct") { + collectCall.shouldMatchN { + methodCall("collect") { with(it.typeDsl) { - it shouldHaveType gen.t_Stream[gen.t_String] + it shouldHaveType gen.`t_List{String}` } - unspecifiedChildren(2) - } - - argList { - methodCall("collectingAndThen") { + methodCall("distinct") { with(it.typeDsl) { - it shouldHaveType Collector::class[gen.t_String, ts.OBJECT, gen.`t_List{String}`] + it shouldHaveType gen.t_Stream[gen.t_String] } - argList { - methodCall("toList") - methodRef("unmodifiableList") { - unspecifiedChild() - with(it.typeDsl) { - it shouldHaveType gen.t_Function[gen.`t_List{String}`, gen.`t_List{String}`] - it.functionalMethod shouldBe it.typeMirror.streamMethods { it.simpleName == "apply" }.findFirst().get() + unspecifiedChildren(2) + } + + argList { + methodCall("collectingAndThen") { + with(it.typeDsl) { + it shouldHaveType Collector::class[gen.t_String, ts.OBJECT, gen.`t_List{String}`] + } + + argList { + methodCall("toList") + methodRef("unmodifiableList") { + unspecifiedChild() + with(it.typeDsl) { + it shouldHaveType gen.t_Function[gen.`t_List{String}`, gen.`t_List{String}`] + it.functionalMethod shouldBe it.typeMirror.streamMethods { it.simpleName == "apply" } + .findFirst().get() + } } } } @@ -598,8 +614,9 @@ class Scratch { } parserTest("Method refs disambiguation between static methods") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.function.IntConsumer; class Scratch { @@ -620,44 +637,48 @@ class Scratch { ic = Scratch::baz; } } - """.trimIndent()) + """.trimIndent() + ) - val (fooRef, barRef, bazRef) = acu.descendants(ASTMethodReference::class.java).toList() + val (fooRef, barRef, bazRef) = acu.descendants(ASTMethodReference::class.java).toList() - val t_IntConsumer = with(acu.typeDsl) { IntConsumer::class.decl } + val t_IntConsumer = with(acu.typeDsl) { IntConsumer::class.decl } - fooRef.shouldMatchN { - methodRef("foo") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + fooRef.shouldMatchN { + methodRef("foo") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() + unspecifiedChild() + } } - } - barRef.shouldMatchN { - methodRef("bar") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + barRef.shouldMatchN { + methodRef("bar") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() + unspecifiedChild() + } } - } - bazRef.shouldMatchN { - methodRef("baz") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + bazRef.shouldMatchN { + methodRef("baz") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() + unspecifiedChild() + } } } } parserTest("Test inexact method ref conflict between static and non-static for primitive type") { - // this is related to the test below, but this works for inexact methods + doTest { + // this is related to the test below, but this works for inexact methods - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.*; class Archive { @@ -669,23 +690,25 @@ class Scratch { .collect(Collectors.joining(", ")); } } - """.trimIndent()) + """.trimIndent() + ) - val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! + val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! - spy.shouldBeOk { - collectCall.shouldMatchN { - methodCall("collect") { - it shouldHaveType gen.t_String + spy.shouldBeOk { + collectCall.shouldMatchN { + methodCall("collect") { + it shouldHaveType gen.t_String - methodCall("mapToObj") { - it shouldHaveType gen.t_Stream[gen.t_String] + methodCall("mapToObj") { + it shouldHaveType gen.t_Stream[gen.t_String] - unspecifiedChildren(2) + unspecifiedChildren(2) + } + + argList(1) } - - argList(1) } } } @@ -693,7 +716,7 @@ class Scratch { parserTest("Exact method ref with primitive receiver cannot select instance methods of wrapper type") { - + doTest { val acu = parser.parse(""" import java.util.stream.IntStream; @@ -716,12 +739,14 @@ class Scratch { unspecifiedChildren(2) } } + } } parserTest("Missing compile-time decl") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ interface IntConsumer { void accept(int i); } class Scratch { @@ -730,17 +755,19 @@ class Scratch { IntConsumer ic = Scratch::foo; } } - """.trimIndent()) + """.trimIndent() + ) - val (t_IntConsumer) = acu.declaredTypeSignatures() - val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() + val (t_IntConsumer) = acu.declaredTypeSignatures() + val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() - fooRef.shouldMatchN { - methodRef("foo") { - it shouldHaveType t_IntConsumer - it.referencedMethod shouldBe it.typeSystem.UNRESOLVED_METHOD + fooRef.shouldMatchN { + methodRef("foo") { + it shouldHaveType t_IntConsumer + it.referencedMethod shouldBe it.typeSystem.UNRESOLVED_METHOD - unspecifiedChild() + unspecifiedChild() + } } } } @@ -748,8 +775,9 @@ class Scratch { parserTest("Method ref inside poly conditional, conditional type is fetched first") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Objects; interface Predicate { @@ -761,26 +789,29 @@ interface Predicate { : object -> targetRef.equals(object); } } - """.trimIndent()) + """.trimIndent() + ) - val t_Predicate = acu.firstTypeSignature() - val testMethod = acu.methodDeclarations().get(0)!! - val tvar = acu.typeVar("T") - val (ternary) = acu.descendants(ASTConditionalExpression::class.java).toList() - val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() + val t_Predicate = acu.firstTypeSignature() + val testMethod = acu.methodDeclarations().get(0)!! + val tvar = acu.typeVar("T") + val (ternary) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() - spy.shouldBeOk { - ternary shouldHaveType t_Predicate[tvar] - fooRef.functionalMethod.shouldBeSomeInstantiationOf(testMethod.genericSignature) - fooRef shouldHaveType t_Predicate[tvar] + spy.shouldBeOk { + ternary shouldHaveType t_Predicate[tvar] + fooRef.functionalMethod.shouldBeSomeInstantiationOf(testMethod.genericSignature) + fooRef shouldHaveType t_Predicate[tvar] + } } } parserTest("Method ref on static class") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.Arrays; import java.util.Objects; import java.util.stream.Stream; @@ -793,36 +824,38 @@ interface Predicate { } } - """.trimIndent()) + """.trimIndent() + ) - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("map") { - it shouldHaveType with(it.typeDsl) { - gen.t_Stream[gen.t_String] - } - - it::getQualifier shouldBe methodCall("stream") { + call.shouldMatchN { + methodCall("map") { it shouldHaveType with(it.typeDsl) { - gen.t_Stream[ts.OBJECT] + gen.t_Stream[gen.t_String] } - unspecifiedChildren(2) - } + it::getQualifier shouldBe methodCall("stream") { + it shouldHaveType with(it.typeDsl) { + gen.t_Stream[ts.OBJECT] + } - argList { + unspecifiedChildren(2) + } - methodRef("toString") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( + argList { + + methodRef("toString") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( named = "toString", declaredIn = java.util.Objects::class.raw, withFormals = listOf(ts.OBJECT), returning = ts.STRING - ) + ) + } + unspecifiedChild() } - unspecifiedChild() } } } @@ -832,8 +865,9 @@ interface Predicate { parserTest("Method ref where target type is fully unknown (is an ivar)") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.Map; import java.util.Map.Entry; import java.util.function.Function; @@ -857,55 +891,57 @@ interface Predicate { return args; } } - """.trimIndent()) + """.trimIndent() + ) - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ofEntries") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + call.shouldMatchN { + methodCall("ofEntries") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "ofEntries", declaredIn = call.enclosingType.typeMirror, withFormals = listOf(gen.t_MapEntry[`?` extends gen.t_String, `?` extends gen.t_Function[int.box(), int.box()]].toArray()), returning = gen.t_Map[gen.t_String, gen.t_Function[int.box(), int.box()]] - ) - } - - argList { - - methodCall("entry") { - argList { - unspecifiedChild() - - methodRef("add") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( - named = "add", - declaredIn = call.enclosingType.typeMirror, - withFormals = listOf(int), - returning = int - ) - } - unspecifiedChild() - } - } + ) } - methodCall("entry") { - argList { - unspecifiedChild() + argList { - methodRef("add") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( + methodCall("entry") { + argList { + unspecifiedChild() + + methodRef("add") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( named = "add", declaredIn = call.enclosingType.typeMirror, withFormals = listOf(int), returning = int - ) + ) + } + unspecifiedChild() } + } + } + + methodCall("entry") { + argList { unspecifiedChild() + + methodRef("add") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( + named = "add", + declaredIn = call.enclosingType.typeMirror, + withFormals = listOf(int), + returning = int + ) + } + unspecifiedChild() + } } } } @@ -916,8 +952,9 @@ interface Predicate { parserTest("Method ref with explicit type parameters") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.Optional; class Scratch { @@ -937,44 +974,46 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val (_, t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (_, tvar) = acu.descendants(ASTTypeParameter::class.java).crossFindBoundaries().toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val (_, t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (_, tvar) = acu.descendants(ASTTypeParameter::class.java).crossFindBoundaries().toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("orElseGet") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + call.shouldMatchN { + methodCall("orElseGet") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "orElseGet", declaredIn = Optional::class[t_NodeStream[tvar]], withFormals = listOf(Supplier::class[`?` extends t_NodeStream[tvar]]), returning = t_NodeStream[tvar] - ) - } + ) + } - methodCall("map") { - with(it.typeDsl) { - val capture = captureMatcher(`?` extends tvar) - it.methodType.shouldMatchMethod( + methodCall("map") { + with(it.typeDsl) { + val capture = captureMatcher(`?` extends tvar) + it.methodType.shouldMatchMethod( named = "map", declaredIn = Optional::class[capture], withFormals = listOf(JavaFunction::class[`?` `super` capture, `?` extends t_NodeStream[tvar]]), returning = Optional::class[t_NodeStream[tvar]] - ) - } + ) + } - variableAccess("optNode") + variableAccess("optNode") + + argList { + methodRef("singleton") + } + } argList { - methodRef("singleton") + methodRef("empty") } } - - argList { - methodRef("empty") - } } } } @@ -982,8 +1021,9 @@ class Scratch { parserTest("Test incompatibility with formal interface") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package scratch; @@ -1020,27 +1060,30 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val t_Archive = acu.firstTypeSignature() + val t_Archive = acu.firstTypeSignature() - val mref = acu.descendants(ASTMethodReference::class.java)[1]!! + val mref = acu.descendants(ASTMethodReference::class.java)[1]!! - spy.shouldBeOk { - mref.functionalMethod.shouldMatchMethod( + spy.shouldBeOk { + mref.functionalMethod.shouldMatchMethod( named = "apply", declaredIn = gen.t_Function[gen.t_List[t_Archive], gen.t_String], withFormals = listOf(gen.t_List[t_Archive]), returning = gen.t_String - ) + ) + } } } parserTest("Exact mref with this as lhs, referencing generic instance method, with type params mentioned in the return type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { @@ -1058,23 +1101,26 @@ class Scratch { Map copy(Map m); } } - """.trimIndent()) + """.trimIndent() + ) - val (t_Scratch, t_Map, t_MapMaker) = acu.declaredTypeSignatures() - val (copyToMutable, copy) = acu.declaredMethodSignatures() + val (t_Scratch, t_Map, t_MapMaker) = acu.declaredTypeSignatures() + val (copyToMutable, copy) = acu.declaredMethodSignatures() - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - spy.shouldBeOk { - mref.functionalMethod shouldBe t_MapMaker[gen.t_String].getDeclaredMethod(copy.symbol) - mref.referencedMethod shouldBe copyToMutable // exactly, ie V was not substituted + spy.shouldBeOk { + mref.functionalMethod shouldBe t_MapMaker[gen.t_String].getDeclaredMethod(copy.symbol) + mref.referencedMethod shouldBe copyToMutable // exactly, ie V was not substituted + } } } parserTest("Inexact mref which must differentiate two overridden overloads") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ // reproduces what's in java.util, to not depend on JDK version interface Collection { @@ -1111,18 +1157,20 @@ class Scratch { } - """.trimIndent()) + """.trimIndent() + ) - val (_, _, abstractColl, _, _, _, t_Additioner) = acu.declaredTypeSignatures() - val (_, _, inAbstractColl, plus) = acu.declaredMethodSignatures() + val (_, _, abstractColl, _, _, _, t_Additioner) = acu.declaredTypeSignatures() + val (_, _, inAbstractColl, plus) = acu.declaredMethodSignatures() - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - spy.shouldBeOk { - mref.functionalMethod shouldBe plus - val rvar = plus.typeParameters[0]!! - mref.referencedMethod shouldBe abstractColl[rvar].getDeclaredMethod(inAbstractColl.symbol) - mref shouldHaveType t_Additioner + spy.shouldBeOk { + mref.functionalMethod shouldBe plus + val rvar = plus.typeParameters[0]!! + mref.referencedMethod shouldBe abstractColl[rvar].getDeclaredMethod(inAbstractColl.symbol) + mref shouldHaveType t_Additioner + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt index 66c8fedcd6..86d737258c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt @@ -243,9 +243,10 @@ class OverloadResolutionTest : ProcessorTestSpec({ } parserTest("Test overload resolution with unchecked conversion") { + doTest { - - val acu = parser.parse(""" + val acu = parser.parse( + """ class Scratch { int foo(Class k) {} // this is selected void foo(Object o) {} @@ -255,20 +256,22 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - """.trimIndent()) + """.trimIndent() + ) - val (fooClass) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooClass) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val call = acu.descendants(ASTMethodCall::class.java).first()!! + val call = acu.descendants(ASTMethodCall::class.java).first()!! - call.shouldMatchN { - methodCall("foo") { - it shouldHaveType it.typeSystem.INT - it.methodType.symbol shouldBe fooClass.symbol + call.shouldMatchN { + methodCall("foo") { + it shouldHaveType it.typeSystem.INT + it.methodType.symbol shouldBe fooClass.symbol - argList { - variableAccess("k") { - it shouldHaveType with (it.typeDsl) { Class::class.raw } + argList { + variableAccess("k") { + it shouldHaveType with(it.typeDsl) { Class::class.raw } + } } } } @@ -277,9 +280,9 @@ class OverloadResolutionTest : ProcessorTestSpec({ parserTest("Test primitive conversion in loose phase") { inContext(ExpressionParsingCtx) { - - val acu = parser.parse( - """ + doTest { + val acu = parser.parse( + """ class Foo { void foo(long i) { foo('c'); @@ -287,20 +290,22 @@ class OverloadResolutionTest : ProcessorTestSpec({ void foo(String other) {} } - """) + """ + ) - val fooM = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow() + val fooM = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow() - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("foo") { - it.methodType.apply { - formalParameters shouldBe listOf(it.typeSystem.LONG) - symbol shouldBe fooM.symbol - } - argList { - charLit("'c'") + call.shouldMatchN { + methodCall("foo") { + it.methodType.apply { + formalParameters shouldBe listOf(it.typeSystem.LONG) + symbol shouldBe fooM.symbol + } + argList { + charLit("'c'") + } } } } @@ -309,9 +314,9 @@ class OverloadResolutionTest : ProcessorTestSpec({ } parserTest("#4557 two overloads with boxed types") { - - val acu = parser.parse( - """ + doTest { + val acu = parser.parse( + """ package p; import static p.Static.assertThat; @@ -337,20 +342,21 @@ class OverloadResolutionTest : ProcessorTestSpec({ } """.trimIndent() - ) + ) - val fooM = acu.methodDeclarations().firstOrThrow() - val call = acu.firstMethodCall() + val fooM = acu.methodDeclarations().firstOrThrow() + val call = acu.firstMethodCall() - call.overloadSelectionInfo.should { - it.isFailed shouldBe false - it.methodType.symbol shouldBe fooM.symbol + call.overloadSelectionInfo.should { + it.isFailed shouldBe false + it.methodType.symbol shouldBe fooM.symbol + } } } parserTest("Two overloads with boxed types, widening required, ambiguous") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Static { static { // ambiguous: 1 is int, and neither Double nor Long is more @@ -368,17 +374,18 @@ class OverloadResolutionTest : ProcessorTestSpec({ } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() - spy.shouldBeAmbiguous(call) + val call = acu.firstMethodCall() + spy.shouldBeAmbiguous(call) + } } parserTest("Overload selection must identify fallbacks if any") { - - val acu = parser.parse( - """ + doTest { + val acu = parser.parse( + """ import java.util.Arrays; import java.util.stream.Collectors; import java.lang.reflect.Type; @@ -399,45 +406,47 @@ class Scratch { .collect(Collectors.joining(", "))); } } - """.trimIndent()) + """.trimIndent() + ) - val fooCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val fooCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - fooCall.shouldMatchN { - methodCall("foo") { - argList { - methodCall("collect") { - it shouldHaveType with(it.typeDsl) { gen.t_String } + fooCall.shouldMatchN { + methodCall("foo") { + argList { + methodCall("collect") { + it shouldHaveType with(it.typeDsl) { gen.t_String } - methodCall("map") { + methodCall("map") { + + it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_String] } + + it::getQualifier shouldBe methodCall("stream") { + it.overloadSelectionInfo.isVarargsCall shouldBe false + it shouldHaveType with(it.typeDsl) { gen.t_Stream[Class::class[`?`]] } + unspecifiedChild() + argList { + variableAccess("genArray") { + it shouldHaveType with(it.typeDsl) { Class::class[`?`].toArray() } + } + } + } - it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_String] } - it::getQualifier shouldBe methodCall("stream") { - it.overloadSelectionInfo.isVarargsCall shouldBe false - it shouldHaveType with(it.typeDsl) { gen.t_Stream[Class::class[`?`]] } - unspecifiedChild() argList { - variableAccess("genArray") { - it shouldHaveType with(it.typeDsl) { Class::class[`?`].toArray() } + methodRef("getTypeName") { + with(it.typeDsl) { + it shouldHaveType gen.t_Function[Class::class[`?`], gen.t_String] + } + + skipQualifier() } } } - argList { - methodRef("getTypeName") { - with(it.typeDsl) { - it shouldHaveType gen.t_Function[Class::class[`?`], gen.t_String] - } - - skipQualifier() - } - } + argList(1) } - - - argList(1) } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt index a84034f07b..b67320b2e8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt @@ -127,8 +127,8 @@ class Other { parserTest("Test override from outside class") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Sup { void m() {} @@ -147,18 +147,19 @@ class F { } """.trimIndent() - ) + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + } } } parserTest("Test hidden method from outside class") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Sup { @@ -176,18 +177,19 @@ class F { } """.trimIndent() - ) + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + } } } parserTest("Test hidden method from outside class, when generic") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ interface Collection {} @@ -206,18 +208,19 @@ class F { } """.trimIndent() - ) + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + } } } parserTest("Test hidden method inside class") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Sup { @@ -232,18 +235,19 @@ class Sub extends Sup { } """.trimIndent() - ) + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) + } } } parserTest("Test hidden method inside hiding method") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Sup { @@ -257,18 +261,19 @@ class Sub extends Sup { } """.trimIndent() - ) + ) - val (supM, _) = acu.methodDeclarations().toList { it.genericSignature } + val (supM, _) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(supM) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(supM) + } } } parserTest("Test distinct primitive overloads from import") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import static java.lang.Integer.reverseBytes; // (int) -> int import static java.lang.Long.reverseBytes; // (long) -> long @@ -280,23 +285,24 @@ class Scratch { } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "reverseBytes", declaredIn = long.box(), withFormals = listOf(long), returning = long - ) + ) + } } } parserTest("Test specificity between generic ctors") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C { @@ -311,18 +317,19 @@ class C { } """.trimIndent() - ) - val genericCtor = acu.ctorDeclarations().get(1)!!.genericSignature // new(C) + ) + val genericCtor = acu.ctorDeclarations().get(1)!!.genericSignature // new(C) - spy.shouldBeOk { - acu.firstCtorCall().methodType.shouldBeSomeInstantiationOf(genericCtor) + spy.shouldBeOk { + acu.firstCtorCall().methodType.shouldBeSomeInstantiationOf(genericCtor) + } } } parserTest("Test specificity between generic and non-generic method") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch { @@ -338,18 +345,19 @@ class Scratch { } """.trimIndent() - ) + ) - val (_, specific) = acu.methodDeclarations().toList { it.genericSignature } + val (_, specific) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(specific) + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(specific) + } } } parserTest("Test specificity between lamdbas") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Scratch { @@ -372,24 +380,25 @@ class Scratch { } """.trimIndent() - ) + ) - val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() + val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() - val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() + val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() - spy.shouldBeOk { - ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) - voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) - stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) - polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) + spy.shouldBeOk { + ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) + voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) + stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) + polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) + } } } parserTest("Test specificity between exact mrefs") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface Runnable { void run(); } @@ -412,24 +421,25 @@ class Scratch { } """.trimIndent() - ) + ) - val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() + val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() - val (ctor, voidM, stdM, polyM, ambigM) = acu.methodCalls().toList() + val (ctor, voidM, stdM, polyM, ambigM) = acu.methodCalls().toList() - spy.shouldBeAmbiguous(ambigM) + spy.shouldBeAmbiguous(ambigM) - ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) - voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) - stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) - polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) + ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) + voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) + stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) + polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) + } } parserTest("Test specificity between implicitly typed lamdbas (ambiguous)") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface Runnable { void run(Object o); } @@ -451,13 +461,14 @@ class Scratch { } """.trimIndent() - ) + ) - val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() - spy.shouldBeAmbiguous(ctor) - spy.shouldBeAmbiguous(voidM) - spy.shouldBeAmbiguous(stdM) - spy.shouldBeAmbiguous(polyM) + val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() + spy.shouldBeAmbiguous(ctor) + spy.shouldBeAmbiguous(voidM) + spy.shouldBeAmbiguous(stdM) + spy.shouldBeAmbiguous(polyM) + } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt index c7f41da2b8..7cf6c31c23 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt @@ -116,7 +116,9 @@ class Scratch { parserTest("Primitive signatures do not merge") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { void m(long t) { } @@ -125,18 +127,21 @@ class Scratch { } } """.trimIndent() - ) + ) - val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } + val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } - assertFalse("Methods are not override-equivalent") { - TypeOps.areOverrideEquivalent(scratchM, otherM) + assertFalse("Methods are not override-equivalent") { + TypeOps.areOverrideEquivalent(scratchM, otherM) + } } } parserTest("Primitive signatures do not merge 2") { - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { void m(int t) { } @@ -145,20 +150,22 @@ class Scratch { } } """.trimIndent() - ) + ) - val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } + val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } - assertFalse("Methods are not override-equivalent") { - TypeOps.areOverrideEquivalent(scratchM, otherM) + assertFalse("Methods are not override-equivalent") { + TypeOps.areOverrideEquivalent(scratchM, otherM) + } } } parserTest("Static generic method") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Sup { static E m(F e) { return null; } } @@ -173,19 +180,21 @@ class F { } } """.trimIndent() - ) + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - assertTrue("Methods are override-equivalent") { - TypeOps.areOverrideEquivalent(supE, subE) + assertTrue("Methods are override-equivalent") { + TypeOps.areOverrideEquivalent(supE, subE) + } } } - parserTest("Static method with different bound") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + parserTest("Static method with different bound") { + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; class Sup { static E m(F e) { return null; } @@ -204,28 +213,30 @@ class F { } } """.trimIndent() - ) + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - // their type parameters have a different bound - // technically this is a compile-time error: - // both methods have the same erasure but neither hides the other - assertFalse("Methods should not override each other\n\t$subE\n\t$supE") { - TypeOps.overrides(subE, supE, subE.declaringType) + // their type parameters have a different bound + // technically this is a compile-time error: + // both methods have the same erasure but neither hides the other + assertFalse("Methods should not override each other\n\t$subE\n\t$supE") { + TypeOps.overrides(subE, supE, subE.declaringType) + } + + spy.shouldBeAmbiguous(acu.firstMethodCall()) + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE } - - spy.shouldBeAmbiguous(acu.firstMethodCall()) - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE } parserTest("Static method of interface is not inherited!") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface List {} interface Sup { @@ -244,26 +255,28 @@ class F implements List> { } } """.trimIndent() - ) + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - // their type parameters have a different bound - assertFalse("Methods should not be override-equivalent") { - TypeOps.overrides(subE, supE, subE.declaringType) - } + // their type parameters have a different bound + assertFalse("Methods should not be override-equivalent") { + TypeOps.overrides(subE, supE, subE.declaringType) + } - spy.shouldBeOk { - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE + spy.shouldBeOk { + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE + } } } parserTest("Static method of interface is not inherited in subinterfaces either") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface List {} interface Sup { @@ -282,18 +295,19 @@ class F implements List> { } } """.trimIndent() - ) + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - // their type parameters have a different bound - assertFalse("Methods should not be override-equivalent") { - TypeOps.overrides(subE, supE, subE.declaringType) - } + // their type parameters have a different bound + assertFalse("Methods should not be override-equivalent") { + TypeOps.overrides(subE, supE, subE.declaringType) + } - spy.shouldBeOk { - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE + spy.shouldBeOk { + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index cfdc9d9f1d..90d3caf1ca 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -19,8 +19,9 @@ import java.io.OutputStream class PolyResolutionTest : ProcessorTestSpec({ parserTest("Test context passing overcomes null lower bound") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { java.util.List asList(T[] arr) { return null; } @@ -29,18 +30,21 @@ class PolyResolutionTest : ProcessorTestSpec({ java.util.List c = asList(null); } } - """) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.`t_List{Integer}` + spy.shouldBeOk { + call shouldHaveType gen.`t_List{Integer}` + } } } parserTest("Test nested ternaries in invoc ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static T id(T t) { return t; } @@ -51,35 +55,38 @@ class PolyResolutionTest : ProcessorTestSpec({ : Double.NaN); } } - """) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("id") { - argList { - ternaryExpr { - it shouldHaveType double - - unspecifiedChildren(2) + spy.shouldBeOk { + call.shouldMatchN { + methodCall("id") { + argList { ternaryExpr { it shouldHaveType double - unspecifiedChildren(3) + unspecifiedChildren(2) + ternaryExpr { + it shouldHaveType double + + unspecifiedChildren(3) + } } } } } - } - call shouldHaveType double.box() + call shouldHaveType double.box() + } } } parserTest("Test standalonable ternary in invoc ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ String packageName = "", className = ""; String.format("L%s%s%s;", @@ -87,13 +94,15 @@ class PolyResolutionTest : ProcessorTestSpec({ (packageName.length() > 0 ? "/" : ""), className); }} - """) + """ + ) - val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() - spy.shouldBeOk { - // not String (this is not a standalone, just in an invocation ctx) - ternary shouldHaveType ts.OBJECT + spy.shouldBeOk { + // not String (this is not a standalone, just in an invocation ctx) + ternary shouldHaveType ts.OBJECT + } } } @@ -157,8 +166,9 @@ class O { parserTest("Ternaries with an additive expr as context") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class O { public static String toString(Class c) { @@ -166,21 +176,24 @@ class O { + c.getName(); } } - """.trimIndent()) + """.trimIndent() + ) - val additive = acu.descendants(ASTReturnStatement::class.java).firstOrThrow().expr!! + val additive = acu.descendants(ASTReturnStatement::class.java).firstOrThrow().expr!! - spy.shouldBeOk { - additive shouldHaveType ts.STRING + spy.shouldBeOk { + additive shouldHaveType ts.STRING + } } } parserTest("Standalone ctor in invocation ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.io.*; class O { @@ -188,26 +201,29 @@ class O { new DataOutputStream(new BufferedOutputStream(out)); } } - """.trimIndent()) + """.trimIndent() + ) - val (outerCtor, innerCtor) = acu.ctorCalls().toList() + val (outerCtor, innerCtor) = acu.ctorCalls().toList() - spy.shouldBeOk { - outerCtor shouldHaveType DataOutputStream::class.raw - innerCtor shouldHaveType BufferedOutputStream::class.raw + spy.shouldBeOk { + outerCtor shouldHaveType DataOutputStream::class.raw + innerCtor shouldHaveType BufferedOutputStream::class.raw - innerCtor.overloadSelectionInfo.let { - it::isFailed shouldBe false - it::needsUncheckedConversion shouldBe false + innerCtor.overloadSelectionInfo.let { + it::isFailed shouldBe false + it::needsUncheckedConversion shouldBe false + } } } } parserTest("Method call in invocation ctx of standalone ctor") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.io.*; class O { @@ -219,26 +235,29 @@ class O { static OutputStream wrap(OutputStream out) { return out; } } - """.trimIndent()) + """.trimIndent() + ) - val (outerCtor, wrapCall) = acu.descendants(InvocationNode::class.java).toList() + val (outerCtor, wrapCall) = acu.descendants(InvocationNode::class.java).toList() - spy.shouldBeOk { - outerCtor shouldHaveType DataOutputStream::class.raw - wrapCall shouldHaveType OutputStream::class.raw + spy.shouldBeOk { + outerCtor shouldHaveType DataOutputStream::class.raw + wrapCall shouldHaveType OutputStream::class.raw - wrapCall.overloadSelectionInfo.let { - it::isFailed shouldBe false - it::needsUncheckedConversion shouldBe false + wrapCall.overloadSelectionInfo.let { + it::isFailed shouldBe false + it::needsUncheckedConversion shouldBe false + } } } } parserTest("Method call in some ternary bug") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class O { @@ -250,21 +269,23 @@ class O { } } - """.trimIndent()) + """.trimIndent() + ) - val ternary = + val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() - ternary.shouldMatchN { - ternaryExpr { - unspecifiedChild() - unspecifiedChild() - methodCall("length") { - it shouldHaveType it.typeSystem.INT + ternary.shouldMatchN { + ternaryExpr { + unspecifiedChild() + unspecifiedChild() + methodCall("length") { + it shouldHaveType it.typeSystem.INT - unspecifiedChild() - unspecifiedChild() + unspecifiedChild() + unspecifiedChild() + } } } } @@ -274,8 +295,9 @@ class O { parserTest("Cast context doesn't constrain invocation type") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ class Scratch { static T id(T t) { @@ -289,32 +311,35 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val (t_Scratch) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("id") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( + call.shouldMatchN { + methodCall("id") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( named = "id", declaredIn = t_Scratch, withFormals = listOf(gen.t_Comparable), returning = gen.t_Comparable - ) - } + ) + } - argList(1) + argList(1) + } } } } parserTest("Test C-style array dimensions as target type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Iterator; import java.util.Map; @@ -327,23 +352,26 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val t_Scratch = acu.firstTypeSignature() + val t_Scratch = acu.firstTypeSignature() - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldMatchMethod( + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldMatchMethod( named = "getArr", declaredIn = t_Scratch, withFormals = listOf(ts.STRING.toArray()), returning = ts.STRING.toArray() - ) + ) + } } } parserTest("Array initializer is an assignment context") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { { @@ -359,20 +387,23 @@ class Scratch { } } - """.trimIndent()) + """.trimIndent() + ) - val (lambda1, lambda2, lambda3) = acu.descendants(ASTLambdaExpression::class.java).toList() + val (lambda1, lambda2, lambda3) = acu.descendants(ASTLambdaExpression::class.java).toList() - spy.shouldBeOk { - lambda1 shouldHaveType Runnable::class.decl - lambda2 shouldHaveType Runnable::class.decl - lambda3 shouldHaveType Runnable::class.decl + spy.shouldBeOk { + lambda1 shouldHaveType Runnable::class.decl + lambda2 shouldHaveType Runnable::class.decl + lambda3 shouldHaveType Runnable::class.decl + } } } parserTest("Test inference with varargs - bug #4980") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.Stream; class Foo { @@ -384,18 +415,21 @@ class Scratch { return Stream.of(foo()); } } - """) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.`t_Stream{Number}` + spy.shouldBeOk { + call shouldHaveType gen.`t_Stream{Number}` + } } } parserTest("Test bound checks does not throw concurrent mod exception") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.Stream; class Enum> {} class EnumSet> { @@ -404,13 +438,15 @@ class Scratch { } private static > U[] getUniverse(Class elementType) {} } - """) + """ + ) - val call = acu.firstMethodCall() - val xVar = acu.typeVar("X") + val call = acu.firstMethodCall() + val xVar = acu.typeVar("X") - spy.shouldBeOk { - call shouldHaveType xVar.toArray() + spy.shouldBeOk { + call shouldHaveType xVar.toArray() + } } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt index 12e83452f6..fff6dd8872 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt @@ -93,69 +93,73 @@ class SpecialMethodsTest : ProcessorTestSpec({ } parserTest("Test enum methods") { + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + import java.util.Arrays; - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - import java.util.Arrays; - - enum Foo { - ; - - { - Arrays.stream(values()); + enum Foo { + ; + + { + Arrays.stream(values()); + } } + + """.trimIndent() + ) + + val t_Foo = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror + + val streamCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + + spy.shouldBeOk { + streamCall shouldHaveType gen.t_Stream[t_Foo] + streamCall.arguments[0] shouldHaveType t_Foo.toArray() } - - """.trimIndent() - ) - - val t_Foo = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror - - val streamCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - spy.shouldBeOk { - streamCall shouldHaveType gen.t_Stream[t_Foo] - streamCall.arguments[0] shouldHaveType t_Foo.toArray() } } parserTest("getClass in invocation ctx, unchecked conversion") { + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + class Scratch { + public static T[] copyOf(U[] original, Class newType) { + return null; + } - class Scratch { - public static T[] copyOf(U[] original, Class newType) { - return null; + + public static T[] doCopy(T[] a) { + E[] elements = null; + return (T[]) copyOf(elements, a.getClass()); + } } + """.trimIndent() + ) - public static T[] doCopy(T[] a) { - E[] elements = null; - return (T[]) copyOf(elements, a.getClass()); - } - } + acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null - """.trimIndent()) + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null + spy.shouldBeOk { + call.shouldMatchN { + methodCall("copyOf") { + it shouldHaveType ts.OBJECT.toArray() - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + argList { + variableAccess("elements") - spy.shouldBeOk { - call.shouldMatchN { - methodCall("copyOf") { - it shouldHaveType ts.OBJECT.toArray() + methodCall("getClass") { + it shouldHaveType Class::class[`?` extends ts.OBJECT.toArray()] - argList { - variableAccess("elements") + variableAccess("a") - methodCall("getClass") { - it shouldHaveType Class::class[`?` extends ts.OBJECT.toArray()] - - variableAccess("a") - - argList(0) + argList(0) + } } } } @@ -165,30 +169,33 @@ class SpecialMethodsTest : ProcessorTestSpec({ parserTest("Record ctor formal param reference") { + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" - - record Foo(int comp) { - Foo { - comp = comp - 1; + record Foo(int comp) { + Foo { + comp = comp - 1; + } } - } - """.trimIndent()) + """.trimIndent() + ) - val (compLhs, compRhs) = acu.descendants(ASTVariableAccess::class.java).toList() - val id = acu.varId("comp") + val (compLhs, compRhs) = acu.descendants(ASTVariableAccess::class.java).toList() + val id = acu.varId("comp") - spy.shouldBeOk { - compLhs.referencedSym.shouldBeA { - it.tryGetNode() shouldBe id - it.declaringSymbol.shouldBeA() - } + spy.shouldBeOk { + compLhs.referencedSym.shouldBeA { + it.tryGetNode() shouldBe id + it.declaringSymbol.shouldBeA() + } - // same spec - compRhs.referencedSym.shouldBeA { - it.tryGetNode() shouldBe id - it.declaringSymbol.shouldBeA() + // same spec + compRhs.referencedSym.shouldBeA { + it.tryGetNode() shouldBe id + it.declaringSymbol.shouldBeA() + } } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index e7877f7152..11893082fc 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -97,27 +97,29 @@ class StandaloneTypesTest : ProcessorTestSpec({ parserTest("Test array initializer") { + doTest { + val block = StatementParsingCtx.parseNode("{ int[] is = { a }; int[][] iis = { { } }; }", ctx = this) + val (oneDim, twoDim, nested) = block.descendants(ASTArrayInitializer::class.java).toList() + with(block.typeDsl) { + oneDim shouldHaveType int.toArray() - val block = StatementParsingCtx.parseNode("{ int[] is = { a }; int[][] iis = { { } }; }", ctx = this) - val (oneDim, twoDim, nested) = block.descendants(ASTArrayInitializer::class.java).toList() - with(block.typeDsl) { - oneDim shouldHaveType int.toArray() - - withClue("Multi dim array") { - twoDim shouldHaveType int.toArray(2) - nested shouldHaveType int.toArray() + withClue("Multi dim array") { + twoDim shouldHaveType int.toArray(2) + nested shouldHaveType int.toArray() + } } } } parserTest("Test array allocation") { - + doTest { val block = StatementParsingCtx.parseNode("{ Object is = new int[0]; is = new String[0][]; }", ctx = this) val (intArray, stringArray) = block.descendants(ASTArrayAllocation::class.java).toList() with(block.typeDsl) { intArray shouldHaveType int.toArray() stringArray shouldHaveType ts.STRING.toArray(2) } + } } @@ -127,9 +129,7 @@ class StandaloneTypesTest : ProcessorTestSpec({ listOf(CHAR, BYTE, SHORT, INT, LONG).forEach { kind -> - val block = doParse("{ $kind v; v++; v--; --v; ++v; }") - - block.shouldMatchN { + "{ $kind v; v++; v--; --v; ++v; }" should parseAs { block { localVarDecl() @@ -254,20 +254,21 @@ class StandaloneTypesTest : ProcessorTestSpec({ } parserTest("Test field access on type variable") { + doTest { + val method = TypeBodyParsingCtx.parseNode(" void foo(T t) { t.length++; }", ctx = this) - val method = TypeBodyParsingCtx.parseNode(" void foo(T t) { t.length++; }", ctx = this) + val tvar = method.descendants(ASTTypeParameter::class.java).firstOrThrow().typeMirror + val fieldAccess = method.descendants(ASTFieldAccess::class.java).firstOrThrow() - val tvar = method.descendants(ASTTypeParameter::class.java).firstOrThrow().typeMirror - val fieldAccess = method.descendants(ASTFieldAccess::class.java).firstOrThrow() - - fieldAccess.shouldMatchN { - fieldAccess("length") { - variableAccess("t") { - it shouldHaveType tvar + fieldAccess.shouldMatchN { + fieldAccess("length") { + variableAccess("t") { + it shouldHaveType tvar + } + it shouldHaveType it.typeSystem.INT + it.referencedSym shouldNotBe null + it.referencedSym!!.enclosingClass shouldBe it.typeSystem.getClassSymbol(IntArray::class.java) } - it shouldHaveType it.typeSystem.INT - it.referencedSym shouldNotBe null - it.referencedSym!!.enclosingClass shouldBe it.typeSystem.getClassSymbol(IntArray::class.java) } } } @@ -289,9 +290,9 @@ class StandaloneTypesTest : ProcessorTestSpec({ } parserTest("Test annotations in package-info") { - - val acu = parser.parse( - """ + doTest { + val acu = parser.parse( + """ // in a package-info.java @net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum( value = net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum.Foo.A @@ -299,23 +300,24 @@ class StandaloneTypesTest : ProcessorTestSpec({ package foo; """.trimIndent() - ) + ) - val annot = acu.descendants(ASTAnnotation::class.java).firstOrThrow() + val annot = acu.descendants(ASTAnnotation::class.java).firstOrThrow() - annot.withTypeDsl { - annot shouldHaveType AnnotationWithEnum::class.decl - val value = annot.members.firstOrThrow() - value.value.shouldMatchN { - fieldAccess("A") { - typeExpr { - classType("Foo") { - classType("AnnotationWithEnum") { - it::isFullyQualified shouldBe true + annot.withTypeDsl { + annot shouldHaveType AnnotationWithEnum::class.decl + val value = annot.members.firstOrThrow() + value.value.shouldMatchN { + fieldAccess("A") { + typeExpr { + classType("Foo") { + classType("AnnotationWithEnum") { + it::isFullyQualified shouldBe true + } } } + it shouldHaveType AnnotationWithEnum.Foo::class.decl } - it shouldHaveType AnnotationWithEnum.Foo::class.decl } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt index 1df6c2b657..b52288fa63 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt @@ -113,9 +113,11 @@ class StressTest : ProcessorTestSpec({ } parserTest("OpenJDK bug 8055984: type inference exponential compilation performance") { - // https://bugs.openjdk.java.net/browse/JDK-8055984 + doTest { + // https://bugs.openjdk.java.net/browse/JDK-8055984 - val acu = parser.parse(""" + val acu = parser.parse( + """ class C { U fu; C() {} @@ -137,9 +139,10 @@ class StressTest : ProcessorTestSpec({ C c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); // 3600 } } - """) + """ + ) - acu.descendants(ASTLocalVariableDeclaration::class.java) + acu.descendants(ASTLocalVariableDeclaration::class.java) .map { it.varIds[0]!!.initializer!! } .forEachIndexed { i, expr -> val t = measureTimeMillis { @@ -147,12 +150,15 @@ class StressTest : ProcessorTestSpec({ } myLog("c${i + 2}: $t ms") } + } } parserTest("OpenJDK bug 8225508: Compiler OOM Error with Type Inference Hierarchy") { - // https://bugs.openjdk.java.net/browse/JDK-8225508 + doTest { + // https://bugs.openjdk.java.net/browse/JDK-8225508 - val acu = parser.parse(""" + val acu = parser.parse( + """ import java.util.Arrays; import java.util.List; @@ -229,20 +235,23 @@ class StressTest : ProcessorTestSpec({ Arrays.asList(baz1, baz2, baz3); } } - """.trimIndent()) + """.trimIndent() + ) - acu.descendants(ASTLocalVariableDeclaration::class.java) + acu.descendants(ASTLocalVariableDeclaration::class.java) .map { it.varIds[0]!! } .filter { it.name.startsWith("asList") } .map { it.initializer!! } .forEachIndexed { i, expr -> - val t = measureTimeMillis { // todo these measurements are not accurate because typeres is done strictly now - assertFalse { - expr.typeMirror == expr.typeSystem.UNKNOWN + val t = + measureTimeMillis { // todo these measurements are not accurate because typeres is done strictly now + assertFalse { + expr.typeMirror == expr.typeSystem.UNKNOWN + } } - } myLog("asList$i: $t ms") } + } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt index 05ecc933b9..90a1557695 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt @@ -14,8 +14,9 @@ import net.sourceforge.pmd.lang.java.types.* class TypeAnnotationsInferenceTest : ProcessorTestSpec({ parserTest("Test type annotation propagate even with boxing") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.lang.annotation.*; class Foo { @Target(ElementType.TYPE_USE) @@ -35,24 +36,26 @@ class Foo { } """.trimIndent() - ) + ) - val (_, A) = acu.typeDeclarations().toList { it.symbol } + val (_, A) = acu.typeDeclarations().toList { it.symbol } - spy.shouldBeOk { - val `@A Integer` = `@`(A) on int.box() - acu.firstMethodCall() shouldHaveType `@A Integer` - acu.varId("i2") shouldHaveType `@A Integer` + spy.shouldBeOk { + val `@A Integer` = `@`(A) on int.box() + acu.firstMethodCall() shouldHaveType `@A Integer` + acu.varId("i2") shouldHaveType `@A Integer` - acu.methodCalls().get(1)!! shouldHaveType (`@`(A) on ts.STRING) - acu.varId("s2") shouldHaveType ts.STRING + acu.methodCalls().get(1)!! shouldHaveType (`@`(A) on ts.STRING) + acu.varId("s2") shouldHaveType ts.STRING + } } } parserTest("Test type annotations do not break wildcard capture") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.lang.annotation.*; class Foo { @Target(ElementType.TYPE_USE) @@ -66,18 +69,19 @@ class Foo { } """.trimIndent() - ) - - val (_, A, t_Predicate) = acu.typeDeclarations().toList { it.symbol } - - - spy.shouldBeOk { - val `@A` = `@`(A) - acu.firstMethodCall() shouldHaveType boolean - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "test", - declaredIn = t_Predicate[captureMatcher( `?` `super` (`@A` on acu.typeVar("T")))] ) + + val (_, A, t_Predicate) = acu.typeDeclarations().toList { it.symbol } + + + spy.shouldBeOk { + val `@A` = `@`(A) + acu.firstMethodCall() shouldHaveType boolean + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "test", + declaredIn = t_Predicate[captureMatcher(`?` `super` (`@A` on acu.typeVar("T")))] + ) + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index 850cfba564..01f84f2c98 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt @@ -57,31 +57,33 @@ class TypeInferenceTest : ProcessorTestSpec({ importedTypes += Arrays::class.java - val call = ExpressionParsingCtx.parseNode("Arrays.asList(1, 2.0)", ctx = this) as ASTMethodCall + doTest { + val call = ExpressionParsingCtx.parseNode("Arrays.asList(1, 2.0)", ctx = this) as ASTMethodCall - val arraysClass = with(call.typeDsl) { Arrays::class.decl } - val asList = arraysClass.getMethodsByName("asList")[0] + val arraysClass = with(call.typeDsl) { Arrays::class.decl } + val asList = arraysClass.getMethodsByName("asList")[0] - call.overloadSelectionInfo.isVarargsCall shouldBe true - call.methodType.also { - it.isVarargs shouldBe true - val (formal, ret) = with(TypeDslOf(it.typeSystem)) { - // we can't hardcode the lub result because it is JDK specific - val `t_lub(Double, Integer)` = ts.lub(double.box(), int.box()) + call.overloadSelectionInfo.isVarargsCall shouldBe true + call.methodType.also { + it.isVarargs shouldBe true + val (formal, ret) = with(TypeDslOf(it.typeSystem)) { + // we can't hardcode the lub result because it is JDK specific + val `t_lub(Double, Integer)` = ts.lub(double.box(), int.box()) - Pair( + Pair( `t_lub(Double, Integer)`, gen.t_List[`t_lub(Double, Integer)`] - ) - } + ) + } - it.formalParameters[0].shouldBeA { - it.componentType shouldBe formal - } + it.formalParameters[0].shouldBeA { + it.componentType shouldBe formal + } - it.returnType shouldBe ret - it.typeParameters shouldBe asList.typeParameters // not substituted + it.returnType shouldBe ret + it.typeParameters shouldBe asList.typeParameters // not substituted + } } } @@ -229,9 +231,9 @@ class TypeInferenceTest : ProcessorTestSpec({ parserTest("Test type var bound substitution in inherited members") { - - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface I {} class C implements I {} @@ -246,21 +248,24 @@ class Scratch { } } } - """.trimIndent()) + """.trimIndent() + ) - val (_, t_C) = acu.declaredTypeSignatures() - val tParam = acu.typeVariables().first { it.name == "T" } + val (_, t_C) = acu.declaredTypeSignatures() + val tParam = acu.typeVariables().first { it.name == "T" } - spy.shouldBeOk { - // fixme this test could be better - acu.firstMethodCall() shouldHaveType t_C[tParam] // of T, not of O + spy.shouldBeOk { + // fixme this test could be better + acu.firstMethodCall() shouldHaveType t_C[tParam] // of T, not of O + } } } parserTest("Test inference var inst substitution in enclosing ctx") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.ArrayList; import java.util.List; @@ -275,24 +280,27 @@ class Scratch { Object res = of(m(t)); } } - """.trimIndent()) + """.trimIndent() + ) - val (ofCall, mCall) = acu.methodCalls().toList() - val (m, of) = acu.methodDeclarations().toList { it.genericSignature } + val (ofCall, mCall) = acu.methodCalls().toList() + val (m, of) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - ofCall shouldHaveType gen.`t_List{String}` - ofCall.methodType shouldBeSomeInstantiationOf of + spy.shouldBeOk { + ofCall shouldHaveType gen.`t_List{String}` + ofCall.methodType shouldBeSomeInstantiationOf of - mCall shouldHaveType gen.t_String - mCall.methodType shouldBeSomeInstantiationOf m + mCall shouldHaveType gen.t_String + mCall.methodType shouldBeSomeInstantiationOf m + } } } parserTest("Constructor with inner class") { - - val acu = parser.parse(""" + doTest { + val acu = parser.parse( + """ import java.util.Iterator; import java.util.Map; @@ -323,45 +331,49 @@ class MyMap { } } - """.trimIndent()) + """.trimIndent() + ) - val (t_MyMap, t_MyMapEntry, t_KeyIter) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (kvar, vvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val (t_MyMap, t_MyMapEntry, t_KeyIter) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } + val (kvar, vvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val ctorCall = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val ctorCall = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - ctorCall.shouldMatchN { - constructorCall { - val `t_MyMap{K,V}KeyIter`: JClassType - val `t_MyMap{K,V}Entry`: JClassType + ctorCall.shouldMatchN { + constructorCall { + val `t_MyMap{K,V}KeyIter`: JClassType + val `t_MyMap{K,V}Entry`: JClassType - with(it.typeDsl) { - `t_MyMap{K,V}KeyIter` = t_MyMap[kvar, vvar].selectInner(t_KeyIter.symbol, emptyList()) - `t_MyMap{K,V}Entry` = t_MyMap[kvar, vvar].selectInner(t_MyMapEntry.symbol, emptyList()) + with(it.typeDsl) { + `t_MyMap{K,V}KeyIter` = t_MyMap[kvar, vvar].selectInner(t_KeyIter.symbol, emptyList()) + `t_MyMap{K,V}Entry` = t_MyMap[kvar, vvar].selectInner(t_MyMapEntry.symbol, emptyList()) - it.methodType.shouldMatchMethod( + it.methodType.shouldMatchMethod( named = JConstructorSymbol.CTOR_NAME, declaredIn = `t_MyMap{K,V}KeyIter`, withFormals = listOf(`t_MyMap{K,V}Entry`, `t_MyMap{K,V}Entry`), returning = `t_MyMap{K,V}KeyIter` - ) - } + ) + } - it::getTypeNode shouldBe classType("KeyIter") { - it shouldHaveType `t_MyMap{K,V}KeyIter` - } + it::getTypeNode shouldBe classType("KeyIter") { + it shouldHaveType `t_MyMap{K,V}KeyIter` + } - argList(2) + argList(2) + } } } - } parserTest("Concurrent modification exception when propagating bounds modifies self var") { - // problem is the ivar for E has Enum as upper bound and no Object, - // so Object is backpropagated to it during its own propagateAllBounds action + doTest { + // problem is the ivar for E has Enum as upper bound and no Object, + // so Object is backpropagated to it during its own propagateAllBounds action - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { void descendingKeyIterator() { @@ -376,17 +388,20 @@ class Foo { enum Tropes { FOO, BAR, baz } } - """.trimIndent()) + """.trimIndent() + ) - spy.shouldBeOk { - acu.firstMethodCall() shouldHaveType void + spy.shouldBeOk { + acu.firstMethodCall() shouldHaveType void + } } } parserTest("#4902 bad intersection") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -407,12 +422,14 @@ public class BadIntersection { .collect(Collectors.toList()); } } - """.trimIndent()) + """.trimIndent() + ) - val (_, t_Animal) = acu.declaredTypeSignatures() + val (_, t_Animal) = acu.declaredTypeSignatures() - spy.shouldBeOk { - acu.firstMethodCall() shouldHaveType java.util.List::class[t_Animal] + spy.shouldBeOk { + acu.firstMethodCall() shouldHaveType java.util.List::class[t_Animal] + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt index 42c7061581..76d93c9f54 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt @@ -14,8 +14,8 @@ import net.sourceforge.pmd.lang.java.types.* class UncheckedInferenceTest : ProcessorTestSpec({ parserTest("Test raw type in argument erases result") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C { @@ -28,29 +28,30 @@ class C { } """.trimIndent() - ) + ) - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "valueOf", declaredIn = t_C, withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), returning = gen.t_Comparable - ) - call shouldHaveType gen.t_Comparable - id shouldHaveType gen.t_Comparable - call.shouldUseUncheckedConversion() + ) + call shouldHaveType gen.t_Comparable + id shouldHaveType gen.t_Comparable + call.shouldUseUncheckedConversion() + } } } parserTest("Test raw type erases result (return type is Class)") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C { @@ -63,29 +64,30 @@ class C { } """.trimIndent() - ) + ) - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.firstMethodCall() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + val call = acu.firstMethodCall() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "valueOf", declaredIn = t_C, withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), returning = Class::class.raw - ) - call shouldHaveType Class::class.raw - id shouldHaveType Class::class[`?`] - call.shouldUseUncheckedConversion() + ) + call shouldHaveType Class::class.raw + id shouldHaveType Class::class[`?`] + call.shouldUseUncheckedConversion() + } } } parserTest("Test f-bound on raw type, explicit Object bound") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.*; @@ -104,26 +106,27 @@ class C { } """.trimIndent() - ) + ) - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "min", declaredIn = t_C, withFormals = listOf(gen.t_Collection[`?` extends gen.t_Comparable]), // Comparable is raw returning = gen.t_Comparable // not Object - ) - call shouldHaveType gen.t_Comparable - call.shouldUseUncheckedConversion() + ) + call shouldHaveType gen.t_Comparable + call.shouldUseUncheckedConversion() + } } } parserTest("Test f-bound on raw type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C { @@ -136,31 +139,33 @@ class C { } """.trimIndent() - ) + ) - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "valueOf", declaredIn = t_C, withFormals = listOf(Class::class[gen.t_Enum]), returning = gen.t_Enum - ) - call shouldHaveType gen.t_Enum - id shouldHaveType gen.t_Enum - call.shouldUseUncheckedConversion() + ) + call shouldHaveType gen.t_Enum + id shouldHaveType gen.t_Enum + call.shouldUseUncheckedConversion() + } } } parserTest("TODO unchecked assignment for intersection") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface I {} @@ -171,26 +176,29 @@ class Scratch { N n = getN(); // unchecked assignment Scratch.I to N } } - """) + """ + ) - val (t_Scratch, t_I) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (nvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val (t_Scratch, t_I) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (nvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.methodType.shouldMatchMethod( named = "getN", declaredIn = t_Scratch, withFormals = emptyList(), returning = nvar * t_I - ) + ) + } } } parserTest("Raw type as target type") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; class Scratch { static { @@ -198,25 +206,28 @@ class Scratch { } static List asList(T... ts) { return null; } } - """) + """ + ) - val (t_Scratch) = acu.typeDeclarations.toList { it.typeMirror } - val call = acu.firstMethodCall() + val (t_Scratch) = acu.typeDeclarations.toList { it.typeMirror } + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.overloadSelectionInfo.isFailed shouldBe false - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.overloadSelectionInfo.isFailed shouldBe false + call.methodType.shouldMatchMethod( named = "asList", declaredIn = t_Scratch, withFormals = listOf(gen.t_String.toArray()), returning = gen.`t_List{String}` - ) + ) + } } } parserTest("Type with raw bound") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ // Note: Enum is raw, not Enum class StringToEnum implements Converter { @@ -238,20 +249,22 @@ class StringToEnum implements Converter { interface Converter { To convert(From source); } - """) + """ + ) - val call = acu.firstMethodCall() - val tparam = acu.typeVar("T") + val call = acu.firstMethodCall() + val tparam = acu.typeVar("T") - spy.shouldBeOk { - call.overloadSelectionInfo::isFailed shouldBe false - call.overloadSelectionInfo::needsUncheckedConversion shouldBe true - call.methodType.shouldMatchMethod( + spy.shouldBeOk { + call.overloadSelectionInfo::isFailed shouldBe false + call.overloadSelectionInfo::needsUncheckedConversion shouldBe true + call.methodType.shouldMatchMethod( named = "valueOf", declaredIn = Enum::class.raw, withFormals = listOf(Class::class[tparam], gen.t_String), returning = Enum::class.raw - ) + ) + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index c240164f9f..b446aa0128 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt @@ -18,8 +18,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldMatchN class UnresolvedTypesRecoveryTest : ProcessorTestSpec({ parserTest("Test failed invoc context lets args be inferred as standalones") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.io.IOException; import ooo.Unresolved; @@ -34,30 +34,31 @@ class C { } """.trimIndent() - ) + ) - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - call.shouldMatchN { - constructorCall { - classType("Unresolved") { - TypeOps.isUnresolved(it.typeMirror) shouldBe true - it.typeMirror.symbol.shouldBeA { - it.binaryName shouldBe "ooo.Unresolved" + call.shouldMatchN { + constructorCall { + classType("Unresolved") { + TypeOps.isUnresolved(it.typeMirror) shouldBe true + it.typeMirror.symbol.shouldBeA { + it.binaryName shouldBe "ooo.Unresolved" + } } - } - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror - argList { - methodCall("getMessage") { - it shouldHaveType it.typeSystem.STRING + argList { + methodCall("getMessage") { + it shouldHaveType it.typeSystem.STRING + variableAccess("ioe") + argList {} + } variableAccess("ioe") - argList {} } - variableAccess("ioe") } } } @@ -65,8 +66,8 @@ class C { parserTest("Test constructor call fallback") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.io.IOException; import ooo.Unresolved; @@ -79,31 +80,32 @@ class C { } """.trimIndent() - ) + ) - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - call.shouldMatchN { - constructorCall { - classType("Unresolved") { - TypeOps.isUnresolved(it.typeMirror) shouldBe true - it.typeMirror.symbol.shouldBeA { - it.binaryName shouldBe "ooo.Unresolved" + call.shouldMatchN { + constructorCall { + classType("Unresolved") { + TypeOps.isUnresolved(it.typeMirror) shouldBe true + it.typeMirror.symbol.shouldBeA { + it.binaryName shouldBe "ooo.Unresolved" + } } + + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror + + argList {} } - - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror - - argList {} } } } parserTest("Test ctor fallback in invoc ctx") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.io.IOException; import ooo.Unresolved; @@ -120,28 +122,30 @@ class C { } """.trimIndent() - ) + ) - val t_Unresolved = acu.descendants(ASTConstructorCall::class.java).firstOrThrow().typeNode.typeMirror as JClassType + val t_Unresolved = + acu.descendants(ASTConstructorCall::class.java).firstOrThrow().typeNode.typeMirror as JClassType - TypeOps.isUnresolved(t_Unresolved) shouldBe true + TypeOps.isUnresolved(t_Unresolved) shouldBe true - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("id") { + call.shouldMatchN { + methodCall("id") { - it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Unresolved), returning = t_Unresolved) + it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Unresolved), returning = t_Unresolved) - argList { - constructorCall { - classType("Unresolved") + argList { + constructorCall { + classType("Unresolved") - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror - argList {} + argList {} + } } } } @@ -149,8 +153,8 @@ class C { } parserTest("Test diamond ctor for unresolved") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import java.io.IOException; import ooo.Unresolved; @@ -163,39 +167,40 @@ class C { } """.trimIndent() - ) + ) - val t_UnresolvedOfString = acu.descendants(ASTClassType::class.java) + val t_UnresolvedOfString = acu.descendants(ASTClassType::class.java) .first { it.simpleName == "Unresolved" }!!.typeMirror.shouldBeA { it.isParameterizedType shouldBe true it.typeArgs shouldBe listOf(it.typeSystem.STRING) } - TypeOps.isUnresolved(t_UnresolvedOfString) shouldBe true + TypeOps.isUnresolved(t_UnresolvedOfString) shouldBe true - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - call.shouldMatchN { - constructorCall { - classType("Unresolved") + call.shouldMatchN { + constructorCall { + classType("Unresolved") - it.usesDiamondTypeArgs() shouldBe true + it.usesDiamondTypeArgs() shouldBe true - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it.overloadSelectionInfo.isFailed shouldBe true - it shouldHaveType t_UnresolvedOfString + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it.overloadSelectionInfo.isFailed shouldBe true + it shouldHaveType t_UnresolvedOfString - argList {} + argList {} + } } } } parserTest("Recovery for primitives in strict invoc") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import ooo.Unresolved; @@ -209,27 +214,28 @@ class C { } """.trimIndent() - ) + ) - val idMethod = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow().symbol + val idMethod = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow().symbol - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("id") { + call.shouldMatchN { + methodCall("id") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod("id", withFormals = listOf(int), returning = void) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe idMethod - } + with(it.typeDsl) { + it.methodType.shouldMatchMethod("id", withFormals = listOf(int), returning = void) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe idMethod + } - argList { - fieldAccess("SOME_INT") { - it shouldHaveType it.typeSystem.UNKNOWN - typeExpr { - classType("Unresolved") + argList { + fieldAccess("SOME_INT") { + it shouldHaveType it.typeSystem.UNKNOWN + typeExpr { + classType("Unresolved") + } } } } @@ -238,8 +244,8 @@ class C { } parserTest("Unresolved types are compatible in type variable bounds") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class C { @@ -255,31 +261,33 @@ class C { } """.trimIndent() - ) + ) - val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") - idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") + val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") + idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("id") { + call.shouldMatchN { + methodCall("id") { - it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Foo), returning = t_Foo) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe idM + it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Foo), returning = t_Foo) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe idM - argList(1) + argList(1) + } } } } parserTest("Unresolved types are used in overload specificity tests") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C { @@ -294,34 +302,39 @@ class C { } """.trimIndent() - ) + ) - val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (t_U1, t_U2) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val (t_U1, t_U2) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } - t_U1.shouldBeUnresolvedClass("U1") - t_U2.shouldBeUnresolvedClass("U2") + t_U1.shouldBeUnresolvedClass("U1") + t_U2.shouldBeUnresolvedClass("U2") - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - it.methodType.shouldMatchMethod("foo", withFormals = listOf(t_U1), returning = it.typeSystem.NO_TYPE) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe foo1 + it.methodType.shouldMatchMethod( + "foo", + withFormals = listOf(t_U1), + returning = it.typeSystem.NO_TYPE + ) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe foo1 - argList(1) + argList(1) + } } } } - } parserTest("Superclass type is known in the subclass") { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class C extends U1 { @@ -335,34 +348,38 @@ class C extends U1 { } """.trimIndent() - ) + ) - val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (t_U1) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val (t_U1) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } - t_U1.shouldBeUnresolvedClass("U1") + t_U1.shouldBeUnresolvedClass("U1") - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - it.methodType.shouldMatchMethod("foo", withFormals = listOf(t_U1), returning = it.typeSystem.NO_TYPE) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe foo1 + it.methodType.shouldMatchMethod( + "foo", + withFormals = listOf(t_U1), + returning = it.typeSystem.NO_TYPE + ) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe foo1 - argList(1) + argList(1) + } } } } - } parserTest("Recovery when there are several applicable overloads") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import ooo.Unresolved; @@ -382,27 +399,28 @@ class C { } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeAmbiguous(call) - acu.withTypeDsl { - call.shouldMatchN { - methodCall("append") { + spy.shouldBeAmbiguous(call) + acu.withTypeDsl { + call.shouldMatchN { + methodCall("append") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod("append", returning = gen.t_StringBuilder) - it.overloadSelectionInfo.isFailed shouldBe true // ambiguity - } + with(it.typeDsl) { + it.methodType.shouldMatchMethod("append", returning = gen.t_StringBuilder) + it.overloadSelectionInfo.isFailed shouldBe true // ambiguity + } - skipQualifier() + skipQualifier() - argList { - fieldAccess("SOMETHING") { - it shouldHaveType it.typeSystem.UNKNOWN - typeExpr { - classType("Unresolved") + argList { + fieldAccess("SOMETHING") { + it shouldHaveType it.typeSystem.UNKNOWN + typeExpr { + classType("Unresolved") + } } } } @@ -412,13 +430,14 @@ class C { } parserTest("Recovery of unknown field using invocation context") { - // This is ignored as doing this kind of thing would be impossible with - // laziness. If we want to resolve stuff like that, we have to resolve - // context first, then push it down into unresolved slots. But standalone - // exprs are used for disambiguation. So we'd probably have to split getTypeMirror - // into a top-down only and a user-facing one. + doTest { + // This is ignored as doing this kind of thing would be impossible with + // laziness. If we want to resolve stuff like that, we have to resolve + // context first, then push it down into unresolved slots. But standalone + // exprs are used for disambiguation. So we'd probably have to split getTypeMirror + // into a top-down only and a user-facing one. - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import ooo.Unresolved; @@ -432,27 +451,28 @@ class C { } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod("foo", withFormals = listOf(int), returning = void) - it.overloadSelectionInfo.isFailed shouldBe false - } + with(it.typeDsl) { + it.methodType.shouldMatchMethod("foo", withFormals = listOf(int), returning = void) + it.overloadSelectionInfo.isFailed shouldBe false + } - argList { - fieldAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType ts.UNKNOWN - it.referencedSym shouldBe null - } - typeExpr { - classType("Unresolved") + argList { + fieldAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType ts.UNKNOWN + it.referencedSym shouldBe null + } + typeExpr { + classType("Unresolved") + } } } } @@ -462,8 +482,8 @@ class C { } parserTest("Recovery of unknown field/var using assignment context") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import ooo.Unresolved; @@ -478,34 +498,35 @@ class C { } """.trimIndent() - ) + ) - val (field, unqual) = acu.descendants(ASTAssignableExpr.ASTNamedReferenceExpr::class.java).toList() + val (field, unqual) = acu.descendants(ASTAssignableExpr.ASTNamedReferenceExpr::class.java).toList() - field.shouldMatchN { - fieldAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null - } - typeExpr { - classType("Unresolved") + field.shouldMatchN { + fieldAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null + } + typeExpr { + classType("Unresolved") + } } } - } - unqual.shouldMatchN { - variableAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType ts.STRING - it.referencedSym shouldBe null + unqual.shouldMatchN { + variableAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType ts.STRING + it.referencedSym shouldBe null + } } } } } parserTest("Unresolved type in primitive switch label") { - - val acu = parser.parse( + doTest { + val acu = parser.parse( """ import ooo.Opcodes.*; @@ -519,31 +540,32 @@ class C { } """.trimIndent() - ) + ) - val (_, a, b) = acu.descendants(ASTVariableAccess::class.java).toList() + val (_, a, b) = acu.descendants(ASTVariableAccess::class.java).toList() - a.shouldMatchN { - variableAccess("A") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null + a.shouldMatchN { + variableAccess("A") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null + } } } - } - b.shouldMatchN { - variableAccess("B") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null + b.shouldMatchN { + variableAccess("B") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null + } } } } } parserTest("Unresolved lambda/mref target type has non-null functional method") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Foo { @@ -556,29 +578,30 @@ class C { } """.trimIndent() - ) + ) - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() - val (mref) = acu.descendants(ASTMethodReference::class.java).toList() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() + val (mref) = acu.descendants(ASTMethodReference::class.java).toList() - val (lambdaCall, mrefCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (lambdaCall, mrefCall) = acu.descendants(ASTMethodCall::class.java).toList() - spy.shouldHaveNoApplicableMethods(lambdaCall) - spy.shouldHaveNoApplicableMethods(mrefCall) + spy.shouldHaveNoApplicableMethods(lambdaCall) + spy.shouldHaveNoApplicableMethods(mrefCall) - acu.withTypeDsl { - lambda shouldHaveType ts.UNKNOWN - lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD + acu.withTypeDsl { + lambda shouldHaveType ts.UNKNOWN + lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref shouldHaveType ts.UNKNOWN - mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + mref shouldHaveType ts.UNKNOWN + mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + } } } parserTest("No context for lambda/mref") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class Foo { @@ -591,45 +614,50 @@ class C { } """.trimIndent() - ) + ) - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() - val (mref) = acu.descendants(ASTMethodReference::class.java).toList() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() + val (mref) = acu.descendants(ASTMethodReference::class.java).toList() - spy.shouldHaveNoLambdaCtx(lambda) - spy.shouldHaveNoLambdaCtx(mref) + spy.shouldHaveNoLambdaCtx(lambda) + spy.shouldHaveNoLambdaCtx(mref) - acu.withTypeDsl { - lambda shouldHaveType ts.UNKNOWN - lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD + acu.withTypeDsl { + lambda shouldHaveType ts.UNKNOWN + lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref shouldHaveType ts.UNKNOWN - mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + mref shouldHaveType ts.UNKNOWN + mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + } } } parserTest("Wrong syntax, return with expr in void method") { - - val (acu, spy) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { void foo() { return foo; } static { return p1; } Foo() { return p2; } } - """) + """ + ) - for (vaccess in acu.descendants(ASTVariableAccess::class.java)) { - spy.shouldBeOk { - vaccess shouldHaveType ts.UNKNOWN + for (vaccess in acu.descendants(ASTVariableAccess::class.java)) { + spy.shouldBeOk { + vaccess shouldHaveType ts.UNKNOWN + } } } } parserTest("Lambda with wrong form") { - - val (acu, _) = parser.parseWithTypeInferenceSpy(""" + doTest { + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ interface Lambda { void call(); } @@ -639,20 +667,23 @@ class C { Lambda l = x -> {}; // wrong form! } } - """) + """ + ) - val (ok, wrong) = acu.descendants(ASTLambdaExpression::class.java).toList() - val t_Lambda = acu.typeDeclarations.firstOrThrow().typeMirror + val (ok, wrong) = acu.descendants(ASTLambdaExpression::class.java).toList() + val t_Lambda = acu.typeDeclarations.firstOrThrow().typeMirror - acu.withTypeDsl { - ok shouldHaveType t_Lambda - wrong shouldHaveType t_Lambda - wrong.parameters[0] shouldHaveType ts.UNKNOWN + acu.withTypeDsl { + ok shouldHaveType t_Lambda + wrong shouldHaveType t_Lambda + wrong.parameters[0] shouldHaveType ts.UNKNOWN + } } } parserTest("Method ref in unresolved call chain") { - /* + doTest { + /* In this test we have Stream.of(/*some expr with unresolved type*/) The difficult thing is that Stream.of has two overloads: of(U) and of(U...), @@ -660,7 +691,8 @@ class C { we want the U to be inferred to (*unknown*) and not Object. */ - val (acu, _) = parser.parseWithTypeInferenceSpy(""" + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ interface Function { R call(T parm); } @@ -679,18 +711,20 @@ class C { } private static Integer toInt(String s) {} } - """) + """ + ) - val (fooToInt) = acu.descendants(ASTMethodReference::class.java).toList() - val (map, streamOf, getString) = acu.methodCalls().toList() - val (t_Function, t_Stream, t_Foo) = acu.declaredTypeSignatures() - val (_, _, _, _, toIntFun) = acu.methodDeclarations().toList { it.symbol } + val (fooToInt) = acu.descendants(ASTMethodReference::class.java).toList() + val (map, streamOf, getString) = acu.methodCalls().toList() + val (t_Function, t_Stream, t_Foo) = acu.declaredTypeSignatures() + val (_, _, _, _, toIntFun) = acu.methodDeclarations().toList { it.symbol } - acu.withTypeDsl { - streamOf shouldHaveType t_Stream[ts.UNKNOWN] - map shouldHaveType t_Stream[ts.INT.box()] - fooToInt shouldHaveType t_Function[ts.UNKNOWN, ts.INT.box()] - fooToInt.referencedMethod.symbol shouldBe toIntFun + acu.withTypeDsl { + streamOf shouldHaveType t_Stream[ts.UNKNOWN] + map shouldHaveType t_Stream[ts.INT.box()] + fooToInt shouldHaveType t_Function[ts.UNKNOWN, ts.INT.box()] + fooToInt.referencedMethod.symbol shouldBe toIntFun + } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt index 30af318ae6..f745f0fc2d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt @@ -13,7 +13,8 @@ import net.sourceforge.pmd.lang.java.types.shouldBeUnresolvedClass class CtorInvocMirrorTest : ProcessorTestSpec({ parserTest("Qualified constructor invocation with unresolved types") { - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Foo { void bar() { @@ -23,14 +24,17 @@ class CtorInvocMirrorTest : ProcessorTestSpec({ class Nested {} } - """) - val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! - invocation.typeMirror shouldNotBe null - invocation.typeMirror.shouldBeUnresolvedClass("Foo.Nested") + """ + ) + val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! + invocation.typeMirror shouldNotBe null + invocation.typeMirror.shouldBeUnresolvedClass("Foo.Nested") + } } parserTest("Qualified constructor invocation with unresolved types uncompilable") { - val acu = parser.parse( + doTest { + val acu = parser.parse( """ class Foo { void bar() { @@ -42,9 +46,11 @@ class CtorInvocMirrorTest : ProcessorTestSpec({ //but PMD should not crash //class Nested {} } - """) - val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! - invocation.typeMirror shouldNotBe null - invocation.typeMirror.shouldBeSameInstanceAs(invocation.typeSystem.UNKNOWN) + """ + ) + val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! + invocation.typeMirror shouldNotBe null + invocation.typeMirror.shouldBeSameInstanceAs(invocation.typeSystem.UNKNOWN) + } } }) From 087893a64dcaed953f6a19a8d5804d689cf2d70e Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 May 2024 10:12:10 +0200 Subject: [PATCH 082/121] [java] Remove unused vars --- .../java/types/internal/infer/UnresolvedTypesRecoveryTest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index b446aa0128..4cae6067cf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt @@ -715,8 +715,8 @@ class C { ) val (fooToInt) = acu.descendants(ASTMethodReference::class.java).toList() - val (map, streamOf, getString) = acu.methodCalls().toList() - val (t_Function, t_Stream, t_Foo) = acu.declaredTypeSignatures() + val (map, streamOf, _) = acu.methodCalls().toList() + val (t_Function, t_Stream, _) = acu.declaredTypeSignatures() val (_, _, _, _, toIntFun) = acu.methodDeclarations().toList { it.symbol } acu.withTypeDsl { From 7d0355bae176e851129e7a9497d3daafa1f0b63f Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 May 2024 10:36:55 +0200 Subject: [PATCH 083/121] Use build-tools 25-SNAPSHOT Refs pmd/build-tools#31 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5b7e66827..06c4079eb0 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ -Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine} - 24 + 25-SNAPSHOT 7.0.0 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar From 3be6df212c93ef109114dd061b91cd070ed65b3a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 17 May 2024 10:44:09 +0200 Subject: [PATCH 084/121] [doc] Update release notes (#5009) --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index f258a94d08..2e1cac683a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -29,6 +29,7 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4467](https://github.com/pmd/pmd/issues/4467): \[core] Expose collections from getters as XPath sequence attributes * [#4978](https://github.com/pmd/pmd/issues/4978): \[core] Referenced Rulesets do not emit details on validation errors * [#4983](https://github.com/pmd/pmd/pull/4983): \[cpd] Fix CPD crashes about unicode escapes + * [#5009](https://github.com/pmd/pmd/issues/5009): \[core] Kotest tests aren't picked up by surefire * java * [#4912](https://github.com/pmd/pmd/issues/4912): \[java] Unable to parse some Java9+ resource references * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD From 04214b43ca36352db92986f72ce68ab286cbb6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 16 May 2024 20:46:32 +0200 Subject: [PATCH 085/121] Improve treatment of lambdas --- .../lang/java/ast/ASTLambdaExpression.java | 8 +++ .../rule/codestyle/UnnecessaryBoxingRule.java | 55 +++++++++++++------ .../rule/codestyle/xml/UnnecessaryBoxing.xml | 42 ++++++++++++++ 3 files changed, 89 insertions(+), 16 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java index dcf14f021d..bdcfc76f45 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java @@ -63,6 +63,14 @@ public final class ASTLambdaExpression extends AbstractJavaExpr implements Funct return (ASTLambdaParameterList) getChild(0); } + public boolean isExplicitlyTyped() { + ASTLambdaParameterList parameters = getParameters(); + if (parameters.isEmpty()) { + return true; + } + + return parameters.toStream().none(ASTLambdaParameter::isTypeInferred); + } /** Returns true if this lambda has a block for body. */ public boolean isBlockBody() { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java index 2444c64ac4..fc0af424e2 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/codestyle/UnnecessaryBoxingRule.java @@ -13,10 +13,13 @@ import org.checkerframework.checker.nullness.qual.Nullable; import net.sourceforge.pmd.lang.java.ast.ASTConstructorCall; import net.sourceforge.pmd.lang.java.ast.ASTExpression; +import net.sourceforge.pmd.lang.java.ast.ASTLambdaExpression; import net.sourceforge.pmd.lang.java.ast.ASTList; import net.sourceforge.pmd.lang.java.ast.ASTMethodCall; +import net.sourceforge.pmd.lang.java.ast.ASTReturnStatement; import net.sourceforge.pmd.lang.java.ast.JavaNode; import net.sourceforge.pmd.lang.java.ast.QualifiableExpression; +import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule; import net.sourceforge.pmd.lang.java.types.JMethodSig; import net.sourceforge.pmd.lang.java.types.JTypeMirror; @@ -150,31 +153,51 @@ public class UnnecessaryBoxingRule extends AbstractJavaRulechainRule { String reason = null; if (sourceType.equals(conversionOutput)) { reason = "boxing of boxed value"; - } else if (ctxType != null) { - JTypeMirror conv = implicitConversionResult(sourceType, ctxType, ctx.getKind()); - if (conv != null - && conv.equals(implicitConversionResult(conversionOutput, ctxType, ctx.getKind())) - && conversionDoesNotChangesValue(sourceType, conversionOutput)) { - if (sourceType.unbox().equals(conversionOutput)) { - reason = "explicit unboxing"; - } else if (sourceType.box().equals(conversionOutput)) { - reason = "explicit boxing"; - } else { - reason = "explicit conversion from " + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) - + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); - if (!conversionOutput.equals(ctxType)) { - reason += " through " + TypePrettyPrint.prettyPrintWithSimpleNames(conversionOutput); - } + } else if (isImplicitlyTypedLambdaReturnExpr(conversionExpr) + || ctxType != null && conversionIsImplicitlyRealisable(sourceType, ctxType, ctx, conversionOutput)) { + if (sourceType.unbox().equals(conversionOutput)) { + reason = "explicit unboxing"; + } else if (sourceType.box().equals(conversionOutput)) { + reason = "explicit boxing"; + } else if (ctxType != null) { + reason = "explicit conversion from " + TypePrettyPrint.prettyPrintWithSimpleNames(sourceType) + + " to " + TypePrettyPrint.prettyPrintWithSimpleNames(ctxType); + if (!conversionOutput.equals(ctxType)) { + reason += " through " + TypePrettyPrint.prettyPrintWithSimpleNames(conversionOutput); } } - } + } if (reason != null) { rctx.addViolation(conversionExpr, reason); } } + private static boolean conversionIsImplicitlyRealisable(JTypeMirror sourceType, JTypeMirror ctxType, ExprContext ctx, JTypeMirror conversionOutput) { + JTypeMirror conv = implicitConversionResult(sourceType, ctxType, ctx.getKind()); + return conv != null + && conv.equals(implicitConversionResult(conversionOutput, ctxType, ctx.getKind())) + && conversionDoesNotChangesValue(sourceType, conversionOutput); + } + + + private boolean isImplicitlyTypedLambdaReturnExpr(ASTExpression e) { + JavaNode parent = e.getParent(); + if (isImplicitlyTypedLambda(parent)) { + return true; + } else if (parent instanceof ASTReturnStatement) { + JavaNode target = JavaAstUtils.getReturnTarget((ASTReturnStatement) parent); + return isImplicitlyTypedLambda(target); + } + return false; + } + + + private static boolean isImplicitlyTypedLambda(JavaNode e) { + return e instanceof ASTLambdaExpression && !((ASTLambdaExpression) e).isExplicitlyTyped(); + } + private boolean isObjectConversionNecessary(ASTExpression e) { JavaNode parent = e.getParent(); return e.getIndexInParent() == 0 && parent instanceof QualifiableExpression; diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 32e04a2843..466dcdba73 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -548,4 +548,46 @@ public class Foo { } ]]> + + Unboxing in lambda return position which returns inferred type + 2 + 2,3 + + Unnecessary explicit unboxing + Unnecessary explicit unboxing + + mismatch = payload -> payload.intValue(); // warn: the interface expects void + RefSpecies i = t -> t.intValue(); // warn: in this context t->t is equivalent because it will be reboxed + + + // In this specific situation below, explicit unboxing + // is necessary to distinguish overloads. Note that if + // the lambda was not explicitly typed it would be an + // ambiguity error. Note also that even if the interfaces are + // not generic in the parameter type, but rather take an Integer + // parameter, implicitly typed lambdas will cause an + // ambiguity error. + // In our implementation we consider that the return position of a + // lambda never needs an explicit boxing or unboxing conversion, and + // ignore this corner case, that is unlikely to show up in real code. + static void foo(IntSpecies f) {} + static void foo(RefSpecies f) {} + static { + foo((Integer i) -> i.intValue()); + foo((Integer i) -> i); + } + interface VoidSpecies { + void doSomething(T t); + } + interface RefSpecies { + X foo(T t); + } + interface IntSpecies { + int foo(T t); + } + } + ]]> + From f1ac913a8b3790d982c01031ba1e03ee3bbac3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Fri, 17 May 2024 13:29:36 +0200 Subject: [PATCH 086/121] Update test references, add tests --- .../lang/java/ast/ASTLambdaExpression.java | 13 ++-- .../lang/java/ast/ASTLambdaExpressionTest.kt | 18 +++++ .../pmd/lang/java/ast/LambdaBug1333.txt | 2 +- .../pmd/lang/java/ast/LambdaBug1470.txt | 8 +-- .../pmd/lang/java/ast/ParserCornerCases18.txt | 66 +++++++++---------- .../java14/YieldStatements.txt | 2 +- .../jdkversiontests/java16/LocalRecords.txt | 4 +- .../ast/jdkversiontests/java16/Records.txt | 2 +- .../Jep443_UnnamedPatternsAndVariables.txt | 2 +- .../Jep456_UnnamedPatternsAndVariables.txt | 2 +- 10 files changed, 69 insertions(+), 50 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java index bdcfc76f45..6083964c17 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpression.java @@ -63,13 +63,14 @@ public final class ASTLambdaExpression extends AbstractJavaExpr implements Funct return (ASTLambdaParameterList) getChild(0); } - public boolean isExplicitlyTyped() { - ASTLambdaParameterList parameters = getParameters(); - if (parameters.isEmpty()) { - return true; - } - return parameters.toStream().none(ASTLambdaParameter::isTypeInferred); + /** + * Return true if this lambda is explicitly typed, meaning + * all parameters have an explicit type. Note that lambdas + * with zero parameters are explicitly typed. + */ + public boolean isExplicitlyTyped() { + return getParameters().toStream().none(ASTLambdaParameter::isTypeInferred); } /** Returns true if this lambda has a block for body. */ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt index 9be4a6400e..0bd93b2796 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt @@ -17,10 +17,22 @@ class ASTLambdaExpressionTest : ParserTestSpec({ inContext(ExpressionParsingCtx) { + "() -> foo()" should parseAs { + exprLambda { + + it::isExplicitlyTyped shouldBe true + it::getParameters shouldBe lambdaFormals {} + + + methodCall("foo") + } + } + "a -> foo()" should parseAs { exprLambda { + it::isExplicitlyTyped shouldBe false it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") { it::isTypeInferred shouldBe true @@ -38,6 +50,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ exprLambda { + it::isExplicitlyTyped shouldBe false it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") { it::isTypeInferred shouldBe true @@ -58,6 +71,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ "(a,b) -> { foo(); } " should parseAs { blockLambda { + it::isExplicitlyTyped shouldBe false it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") @@ -71,6 +85,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ "(final int a, @F List b) -> foo()" should parseAs { exprLambda { + it::isExplicitlyTyped shouldBe true it::getParameters shouldBe lambdaFormals { lambdaParam { @@ -114,6 +129,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ "(final int a[]@B[], @F List@a [] b @A []) -> foo()" should parseAs { exprLambda { + it::isExplicitlyTyped shouldBe true it::getParameters shouldBe child { lambdaParam { @@ -179,6 +195,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ "(String ... b) -> {}" should parseAs { blockLambda { + it::isExplicitlyTyped shouldBe true it::getParameters shouldBe child { lambdaParam { @@ -204,6 +221,7 @@ class ASTLambdaExpressionTest : ParserTestSpec({ "(String @A [] @B ... b) -> {}" should parseAs { blockLambda { + it::isExplicitlyTyped shouldBe true it::getParameters shouldBe child { lambdaParam { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt index 8ed63303b7..27c31b0243 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1333.txt @@ -20,7 +20,7 @@ | +- ExpressionStatement[] | +- MethodCall[@CompileTimeConstant = false, @Image = "delete", @MethodName = "delete", @ParenthesisDepth = 0, @Parenthesized = false] | +- ArgumentList[@Empty = false, @Size = 1] - | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt index 087f538552..eb5f304670 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/LambdaBug1470.txt @@ -24,7 +24,7 @@ | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] | | +- ArgumentList[@Empty = false, @Size = 1] - | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -39,7 +39,7 @@ | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "stuff", @Name = "stuff", @ParenthesisDepth = 0, @Parenthesized = false] | | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "true", @ParenthesisDepth = 0, @Parenthesized = false, @True = true] | +- ArgumentList[@Empty = false, @Size = 1] - | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -58,7 +58,7 @@ | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- ClassType[@FullyQualified = false, @SimpleName = "Observable"] | +- ArgumentList[@Empty = false, @Size = 1] - | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = false, @Size = 1] | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -69,7 +69,7 @@ | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "stuff", @Name = "stuff", @ParenthesisDepth = 0, @Parenthesized = false] | +- BooleanLiteral[@CompileTimeConstant = true, @LiteralText = "true", @ParenthesisDepth = 0, @Parenthesized = false, @True = true] +- ArgumentList[@Empty = false, @Size = 1] - +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt index 5def9e475a..b14bc35dfc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/ParserCornerCases18.txt @@ -22,7 +22,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -39,7 +39,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -55,7 +55,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java3"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -71,7 +71,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "FileFilter"] | | | +- VariableDeclarator[@Initializer = true, @Name = "java4"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "java4", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -93,7 +93,7 @@ | | | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "array", @Name = "array", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -122,7 +122,7 @@ | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -130,7 +130,7 @@ | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -138,7 +138,7 @@ | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -158,7 +158,7 @@ | | | | +- ArrayDimensions[@Empty = false, @Size = 1] | | | | +- ArrayTypeDim[@Varargs = false] | | | +- ArrayInitializer[@CompileTimeConstant = false, @Length = 3, @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -166,7 +166,7 @@ | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "exists", @MethodName = "exists", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -174,7 +174,7 @@ | | | | +- MethodCall[@CompileTimeConstant = false, @Image = "canRead", @MethodName = "canRead", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "f", @Name = "f", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- ArgumentList[@Empty = true, @Size = 0] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -192,7 +192,7 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "user", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "doPrivileged", @MethodName = "doPrivileged", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- MethodCall[@CompileTimeConstant = false, @Image = "getProperty", @MethodName = "getProperty", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] @@ -206,7 +206,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "c"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "done", @Empty = false, @Image = "\"done\"", @Length = 4, @LiteralText = "\"done\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -214,7 +214,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "r"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "r", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -231,9 +231,9 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | | +- VariableDeclarator[@Initializer = true, @Name = "sup"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "sup", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -260,10 +260,10 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "c2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- ConditionalExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "flag", @Name = "flag", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] | | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "23", @IntLiteral = true, @Integral = true, @LiteralText = "23", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 23.0, @ValueAsFloat = 23.0, @ValueAsInt = 23, @ValueAsLong = 23] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 1, @Parenthesized = true] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "42", @IntLiteral = true, @Integral = true, @LiteralText = "42", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 42.0, @ValueAsFloat = 42.0, @ValueAsInt = 42, @ValueAsLong = 42] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] @@ -273,7 +273,7 @@ | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] | | | +- CastExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] - | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = true, @Size = 0] | | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | | +- ExpressionStatement[] @@ -297,7 +297,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "String"] | | | +- VariableDeclarator[@Initializer = true, @Name = "comparer"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "comparer", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -312,7 +312,7 @@ | | +- ExpressionStatement[] | | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "comparer", @Name = "comparer", @ParenthesisDepth = 0, @Parenthesized = false] - | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -336,7 +336,7 @@ | | | +- MethodCall[@CompileTimeConstant = false, @Image = "addActionListener", @MethodName = "addActionListener", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "button", @Name = "button", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -371,7 +371,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -393,7 +393,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Integer"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda2a"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda2a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -414,7 +414,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3"] | | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -442,7 +442,7 @@ | | | +- ClassType[@FullyQualified = false, @SimpleName = "Double"] | | +- VariableDeclarator[@Initializer = true, @Name = "lambda3a"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "lambda3a", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] - | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 3, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 3] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -488,7 +488,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Runnable"] | | +- VariableDeclarator[@Initializer = true, @Name = "r1"] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_PACKAGE, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = true, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "r1", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] - | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] @@ -504,7 +504,7 @@ | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] - | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ExpressionStatement[] @@ -568,7 +568,7 @@ | | | | +- ClassType[@FullyQualified = false, @SimpleName = "K"] | | | | +- ClassType[@FullyQualified = false, @SimpleName = "V"] | | | +- ClassType[@FullyQualified = false, @SimpleName = "Serializable"] - | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -702,7 +702,7 @@ | | +- FormalParameters[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 1, @containsComment = false] | | +- ReturnStatement[] - | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] @@ -776,7 +776,7 @@ | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -827,7 +827,7 @@ | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "2", @IntLiteral = true, @Integral = true, @LiteralText = "2", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 2.0, @ValueAsFloat = 2.0, @ValueAsInt = 2, @ValueAsLong = 2] | | | | | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "3", @IntLiteral = true, @Integral = true, @LiteralText = "3", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 3.0, @ValueAsFloat = 3.0, @ValueAsInt = 3, @ValueAsLong = 3] | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- LambdaExpression[@Arity = 2, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_PACKAGE] | | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -873,7 +873,7 @@ | | +- AssignmentExpression[@CompileTimeConstant = false, @Compound = false, @Operator = AssignmentOp.ASSIGN, @ParenthesisDepth = 0, @Parenthesized = false] | | +- FieldAccess[@AccessType = AccessType.WRITE, @CompileTimeConstant = false, @Image = "event", @Name = "event", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- AmbiguousName[@CompileTimeConstant = false, @Image = "object", @Name = "object", @ParenthesisDepth = 0, @Parenthesized = false] - | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- LambdaParameterList[@Empty = true, @Size = 0] | | +- Block[@Empty = false, @Size = 2, @containsComment = true] | | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt index e054f1877b..242680f8e7 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java14/YieldStatements.txt @@ -73,7 +73,7 @@ | +- YieldStatement[] | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "5", @IntLiteral = true, @Integral = true, @LiteralText = "5", @LongLiteral = false, @ParenthesisDepth = 1, @Parenthesized = true, @ValueAsDouble = 5.0, @ValueAsFloat = 5.0, @ValueAsInt = 5, @ValueAsLong = 5] +- YieldStatement[] - | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] + | +- LambdaExpression[@Arity = 0, @BlockBody = true, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = true, @Size = 0] | +- Block[@Empty = true, @Size = 0, @containsComment = false] +- ExpressionStatement[] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt index 469d4d8963..67a770a2e1 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/LocalRecords.txt @@ -61,7 +61,7 @@ | | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "merchants", @Name = "merchants", @ParenthesisDepth = 0, @Parenthesized = false] | | | | | +- ArgumentList[@Empty = true, @Size = 0] | | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | | +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- LambdaParameterList[@Empty = false, @Size = 1] | | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] @@ -75,7 +75,7 @@ | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "merchant", @Name = "merchant", @ParenthesisDepth = 0, @Parenthesized = false] | | | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "month", @Name = "month", @ParenthesisDepth = 0, @Parenthesized = false] | | | +- ArgumentList[@Empty = false, @Size = 1] - | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | | | +- LambdaExpression[@Arity = 2, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | | | +- LambdaParameterList[@Empty = false, @Size = 2] | | | | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | | | | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt index a06d3dde50..efb0bd364a 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java16/Records.txt @@ -144,7 +144,7 @@ | | +- ClassType[@FullyQualified = false, @SimpleName = "Objects"] | +- ArgumentList[@Empty = false, @Size = 2] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "foo", @Name = "foo", @ParenthesisDepth = 0, @Parenthesized = false] - | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + | +- LambdaExpression[@Arity = 0, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = true, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] | +- LambdaParameterList[@Empty = true, @Size = 0] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "foo", @Empty = false, @Image = "\"foo\"", @Length = 3, @LiteralText = "\"foo\"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "Records$VarRec", @CanonicalName = "Records.VarRec", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "VarRec", @Static = true, @TopLevel = false, @Visibility = Visibility.V_PUBLIC] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt index 482d1fe703..25604f8364 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java21p/Jep443_UnnamedPatternsAndVariables.txt @@ -600,7 +600,7 @@ +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt index 9a4174133e..96e8b54396 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java22/Jep456_UnnamedPatternsAndVariables.txt @@ -600,7 +600,7 @@ +- MethodReference[@CompileTimeConstant = false, @ConstructorReference = false, @MethodName = "toUpperCase", @ParenthesisDepth = 0, @Parenthesized = false] | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | +- ClassType[@FullyQualified = false, @SimpleName = "String"] - +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] + +- LambdaExpression[@Arity = 1, @BlockBody = false, @CompileTimeConstant = false, @ExplicitlyTyped = false, @ExpressionBody = true, @ParenthesisDepth = 0, @Parenthesized = false] +- LambdaParameterList[@Empty = false, @Size = 1] | +- LambdaParameter[@EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @TypeInferred = true, @Visibility = Visibility.V_PACKAGE] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] From 2d33d05d76ea5e6cbf53041305a92b39237bfe16 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Mon, 20 May 2024 13:25:06 +0200 Subject: [PATCH 087/121] [java] Refactor kotest ParserTestSpec tests - introduce parserTestContainer - use either parserTest or parserTestContainer with should/doTest - parserTestGroup is now private - this is to limit DSL options - with too many options maintainability suffers - parserTestContainer should be used instead - there were only 2 test classes, that used parserTestGroup --- .../java/ast/ASTAdditiveExpressionTest.kt | 5 +- .../pmd/lang/java/ast/ASTAnnotationTest.kt | 20 +- .../lang/java/ast/ASTAnonymousClassTest.kt | 6 +- .../pmd/lang/java/ast/ASTArrayAccessTest.kt | 10 +- .../lang/java/ast/ASTArrayAllocationTest.kt | 37 +- .../pmd/lang/java/ast/ASTArrayTypeTest.kt | 12 +- .../java/ast/ASTAssignmentExpressionTest.kt | 8 +- .../lang/java/ast/ASTBinaryExpressionTest.kt | 6 +- .../lang/java/ast/ASTCastExpressionTest.kt | 20 +- .../pmd/lang/java/ast/ASTCatchClauseTest.kt | 23 +- .../lang/java/ast/ASTClassDeclarationTest.kt | 7 +- .../pmd/lang/java/ast/ASTClassLiteralTest.kt | 13 +- .../lang/java/ast/ASTConstructorCallTest.kt | 10 +- .../java/ast/ASTConstructorDeclarationTest.kt | 11 +- .../pmd/lang/java/ast/ASTEnumConstantTest.kt | 33 +- .../java/ast/ASTEqualityExpressionTest.kt | 6 +- .../ASTExplicitConstructorInvocationTest.kt | 41 +- .../pmd/lang/java/ast/ASTFieldAccessTest.kt | 8 +- .../lang/java/ast/ASTFieldDeclarationTest.kt | 10 +- .../java/ast/ASTInstanceOfExpressionTest.kt | 13 +- .../lang/java/ast/ASTLambdaExpressionTest.kt | 38 +- .../pmd/lang/java/ast/ASTLiteralTest.kt | 117 +-- .../ast/ASTLocalVariableDeclarationTest.kt | 6 +- .../pmd/lang/java/ast/ASTMethodCallTest.kt | 27 +- .../lang/java/ast/ASTMethodDeclarationTest.kt | 73 +- .../lang/java/ast/ASTMethodReferenceTest.kt | 27 +- .../lang/java/ast/ASTModuleDeclarationTest.kt | 25 +- .../ast/ASTMultiplicativeExpressionTest.kt | 8 +- .../pmd/lang/java/ast/ASTPatternTest.kt | 8 +- .../java/ast/ASTRelationalExpressionTest.kt | 12 +- .../lang/java/ast/ASTShiftExpressionTest.kt | 8 +- .../pmd/lang/java/ast/ASTStatementsTest.kt | 21 +- .../lang/java/ast/ASTSuperExpressionTest.kt | 12 +- .../lang/java/ast/ASTSwitchExpressionTests.kt | 54 +- .../lang/java/ast/ASTThisExpressionTest.kt | 20 +- .../pmd/lang/java/ast/ASTTryStatementTest.kt | 17 +- .../lang/java/ast/ASTTypeParametersTest.kt | 8 +- .../pmd/lang/java/ast/ASTTypeTest.kt | 14 +- .../lang/java/ast/ASTUnaryExpressionTest.kt | 18 +- .../pmd/lang/java/ast/ASTWildcardTypeTest.kt | 12 +- .../lang/java/ast/ConstValuesKotlinTest.kt | 36 +- .../pmd/lang/java/ast/Java11Test.kt | 122 ++- .../pmd/lang/java/ast/Java15KotlinTest.kt | 5 +- .../pmd/lang/java/ast/JavaTextAccessTest.kt | 9 +- .../pmd/lang/java/ast/KotlinTestingDsl.kt | 11 +- .../lang/java/ast/LanguageLevelCheckTests.kt | 91 +- .../pmd/lang/java/ast/ModifiersTest.kt | 12 +- .../lang/java/ast/OverrideResolutionTest.kt | 44 +- .../pmd/lang/java/ast/ParenthesesTest.kt | 14 +- .../pmd/lang/java/ast/ParserTestSpec.kt | 100 ++- .../lang/java/ast/TypeDisambiguationTest.kt | 183 ++-- .../pmd/lang/java/ast/UsageResolutionTest.kt | 48 +- .../lang/java/ast/VarDisambiguationTest.kt | 12 +- .../symbols/internal/AstSymbolResolverTest.kt | 6 +- .../java/symbols/internal/AstSymbolTests.kt | 32 +- .../table/internal/HeaderScopesTest.kt | 315 +++---- .../table/internal/LocalTypeScopesTest.kt | 54 +- .../table/internal/MemberInheritanceTest.kt | 211 ++--- .../table/internal/PatternVarScopingTests.kt | 101 +-- .../internal/SuperTypesEnumeratorTest.kt | 7 +- .../table/internal/TypeParamScopingTest.kt | 36 +- .../symbols/table/internal/VarScopingTest.kt | 126 ++- .../pmd/lang/java/types/InnerTypesTest.kt | 112 +-- .../pmd/lang/java/types/JMethodSigTest.kt | 58 +- .../pmd/lang/java/types/SamTypesTest.kt | 28 +- .../pmd/lang/java/types/SubstTest.kt | 130 ++- .../pmd/lang/java/types/TypesFromAstTest.kt | 76 +- .../java/types/ast/ConversionContextTests.kt | 392 ++++----- .../types/internal/infer/AnonCtorsTest.kt | 816 +++++++++--------- .../internal/infer/BranchingExprsTests.kt | 89 +- .../internal/infer/CaptureInferenceTest.kt | 361 ++++---- .../types/internal/infer/CtorInferenceTest.kt | 329 ++++--- .../types/internal/infer/ExplicitTypesTest.kt | 73 +- .../internal/infer/Java7InferenceTest.kt | 143 ++- .../internal/infer/LambdaInferenceTest.kt | 526 ++++++----- .../internal/infer/LocalVarInferenceTest.kt | 83 +- .../internal/infer/MethodRefInferenceTest.kt | 690 +++++++-------- .../internal/infer/OverloadResolutionTest.kt | 172 ++-- .../internal/infer/OverloadSpecificityTest.kt | 236 ++--- .../types/internal/infer/OverridingTest.kt | 148 ++-- .../internal/infer/PolyResolutionTest.kt | 292 +++---- .../internal/infer/SpecialMethodsTest.kt | 142 ++- .../internal/infer/StandaloneTypesTest.kt | 132 +-- .../java/types/internal/infer/StressTest.kt | 108 ++- .../infer/TypeAnnotationsInferenceTest.kt | 57 +- .../types/internal/infer/TypeInferenceTest.kt | 201 ++--- .../internal/infer/UncheckedInferenceTest.kt | 258 +++--- .../infer/UnresolvedTypesRecoveryTest.kt | 742 ++++++++-------- .../internal/infer/ast/CtorInvocMirrorTest.kt | 65 +- 89 files changed, 3729 insertions(+), 5129 deletions(-) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAdditiveExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAdditiveExpressionTest.kt index 7967a9cc03..9657afa47c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAdditiveExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAdditiveExpressionTest.kt @@ -9,8 +9,7 @@ import net.sourceforge.pmd.lang.java.ast.BinaryOp.* class ASTAdditiveExpressionTest : ParserTestSpec({ - parserTest("Simple additive expression should be flat") { - + parserTestContainer("Simple additive expression should be flat") { inContext(ExpressionParsingCtx) { "1 + 2 + 3" should parseAs { infixExpr(ADD) { @@ -72,7 +71,7 @@ class ASTAdditiveExpressionTest : ParserTestSpec({ } } - parserTest("Changing operators should push a new node") { + parserTestContainer("Changing operators should push a new node") { inContext(ExpressionParsingCtx) { "1 + 2 - 3" should parseAs { infixExpr(SUB) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt index 3ee795c82f..1655ded777 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnnotationTest.kt @@ -17,19 +17,15 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_5 */ class ASTAnnotationTest : ParserTestSpec({ - - parserTest("Test annot fails before JDK 1.4", javaVersions = Earliest..J1_3) { - + parserTestContainer("Test annot fails before JDK 1.4", javaVersions = Earliest..J1_3) { inContext(AnnotationParsingCtx) { "@F" shouldNot parse() "@F(a=1)" shouldNot parse() } } - parserTest("Marker annotations", javaVersions = J1_5..Latest) { - + parserTestContainer("Marker annotations", javaVersions = J1_5..Latest) { inContext(AnnotationParsingCtx) { - "@F" should parseAs { child { it::getSimpleName shouldBe "F" @@ -66,13 +62,10 @@ class ASTAnnotationTest : ParserTestSpec({ } } } - } - parserTest("Single-value shorthand", javaVersions = J1_5..Latest) { - + parserTestContainer("Single-value shorthand", javaVersions = J1_5..Latest) { inContext(AnnotationParsingCtx) { - "@F(\"ohio\")" should parseAs { child { it::getSimpleName shouldBe "F" @@ -122,6 +115,7 @@ class ASTAnnotationTest : ParserTestSpec({ } } } + "@org.F(@Oh)" should parseAs { child { it::getSimpleName shouldBe "F" @@ -136,13 +130,10 @@ class ASTAnnotationTest : ParserTestSpec({ } } } - } - parserTest("Normal annotation", javaVersions = J1_5..Latest) { - + parserTestContainer("Normal annotation", javaVersions = J1_5..Latest) { inContext(AnnotationParsingCtx) { - "@F(a=\"ohio\")" should parseAs { child { it::getSimpleName shouldBe "F" @@ -179,7 +170,6 @@ class ASTAnnotationTest : ParserTestSpec({ } } - """ @TestAnnotation({@SuppressWarnings({}), @SuppressWarnings(value = {"Beware the ides of March.",}), diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt index d209ba43da..4f90db40b7 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAnonymousClassTest.kt @@ -11,10 +11,8 @@ import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.V_ANONYMOUS class ASTAnonymousClassTest : ParserTestSpec({ - parserTest("Anon class modifiers") { - + parserTestContainer("Anon class modifiers") { inContext(StatementParsingCtx) { - """ new java.lang.Runnable() { @@ -56,6 +54,4 @@ class ASTAnonymousClassTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt index a667e208ad..77bb1209b4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAccessTest.kt @@ -14,12 +14,9 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe */ class ASTArrayAccessTest : ParserTestSpec({ - parserTest("Array access auto disambiguation") { - + parserTestContainer("Array access auto disambiguation") { inContext(ExpressionParsingCtx) { - "a.b[0]" should parseAs { - arrayAccess { it::getQualifier shouldBe fieldAccess("b") { it::getQualifier shouldBe ambiguousName("a") @@ -27,17 +24,12 @@ class ASTArrayAccessTest : ParserTestSpec({ it::getIndexExpression shouldBe int(0) } - } - "b[0]" should parseAs { - arrayAccess { - it::getQualifier shouldBe variableAccess("b") - it::getIndexExpression shouldBe int(0) } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt index b8d6e8502d..f28a3f7fc5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayAllocationTest.kt @@ -15,12 +15,9 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT */ class ASTArrayAllocationTest : ParserTestSpec({ - parserTest("Array creation") { - + parserTestContainer("Array creation") { inContext(ExpressionParsingCtx) { - "new int[2][]" should parseAs { - arrayAlloc { it::getTypeNode shouldBe arrayType({ primitiveType(INT) }) { dimExpr { @@ -33,26 +30,23 @@ class ASTArrayAllocationTest : ParserTestSpec({ "new @Foo int[3][2]" should parseAs { arrayAlloc { - - it::getTypeNode shouldBe arrayType({ - primitiveType(INT) { - annotation("Foo") - } - }) { - dimExpr { - int(3) - } - dimExpr { - int(2) + it::getTypeNode shouldBe arrayType({ + primitiveType(INT) { + annotation("Foo") + } + }) { + dimExpr { + int(3) + } + dimExpr { + int(2) + } + } } } - } -} "new @Foo int @Bar [3][2]" should parseAs { arrayAlloc { - - it::getTypeNode shouldBe arrayType({ primitiveType(INT) { annotation("Foo") @@ -69,7 +63,6 @@ class ASTArrayAllocationTest : ParserTestSpec({ } } - "(new int[3])[2]" should parseAs { arrayAccess { parenthesized { @@ -101,9 +94,8 @@ class ASTArrayAllocationTest : ParserTestSpec({ } } - parserTest("With array initializer") { + parserTestContainer("With array initializer") { inContext(ExpressionParsingCtx) { - "new Foo[] { f, g }" should parseAs { arrayAlloc { @@ -146,6 +138,7 @@ class ASTArrayAllocationTest : ParserTestSpec({ } } } + "new int[][] { { 1 , 2 }, null }" should parseAs { arrayAlloc { it::getArrayDepth shouldBe 2 diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt index 26f70800ba..171f66e28f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTArrayTypeTest.kt @@ -13,13 +13,10 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe */ class ASTArrayTypeTest : ParserTestSpec({ - parserTest("Multi-Dim Array") { + parserTestContainer("Multi-Dim Array") { inContext(TypeParsingCtx) { - "ArrayTypes[][][]" should parseAs { - arrayType { - it::getElementType shouldBe classType("ArrayTypes") it::getDimensions shouldBe dimList { @@ -32,11 +29,9 @@ class ASTArrayTypeTest : ParserTestSpec({ } } - parserTest("Annotated array type") { + parserTestContainer("Annotated array type") { inContext(TypeParsingCtx) { - "ArrayTypes[][] @A []" should parseAs { - arrayType { it::getElementType shouldBe classType("ArrayTypes") @@ -54,10 +49,9 @@ class ASTArrayTypeTest : ParserTestSpec({ } } - parserTest("Multi-Dim Array allocation") { + parserTestContainer("Multi-Dim Array allocation") { inContext(ExpressionParsingCtx) { "new ArrayTypes[][][] { }" should parseAs { - arrayAlloc { arrayType({ diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt index 8706831bfd..4366f0e76d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTAssignmentExpressionTest.kt @@ -14,11 +14,8 @@ import net.sourceforge.pmd.lang.java.ast.AssignmentOp.* * @since 7.0.0 */ class ASTAssignmentExpressionTest : ParserTestSpec({ - - parserTest("Simple assignment expressions") { - + parserTestContainer("Simple assignment expressions") { inContext(ExpressionParsingCtx) { - "a = b -> { foo(b); }" should parseAs { assignmentExpr(ASSIGN) { it::isCompound shouldBe false @@ -104,8 +101,7 @@ class ASTAssignmentExpressionTest : ParserTestSpec({ } } - parserTest("Right associativity") { - + parserTestContainer("Right associativity") { inContext(ExpressionParsingCtx) { "a = b = c" should parseAs { assignmentExpr(ASSIGN) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTBinaryExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTBinaryExpressionTest.kt index cd50b2d1b2..15e856da13 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTBinaryExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTBinaryExpressionTest.kt @@ -11,10 +11,7 @@ import net.sourceforge.pmd.lang.java.ast.BinaryOp.* Tests for the rest of binary expressions */ class ASTBinaryExpressionTest : ParserTestSpec({ - - - parserTest("Conditional and logical operators") { - + parserTestContainer("Conditional and logical operators") { inContext(ExpressionParsingCtx) { "a && b && a || b" should parseAs { infixExpr(CONDITIONAL_OR) { @@ -57,5 +54,4 @@ class ASTBinaryExpressionTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt index bf7f77c20a..8a8987dc8f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCastExpressionTest.kt @@ -10,11 +10,8 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTCastExpressionTest : ParserTestSpec({ - - parserTest("Simple cast") { - + parserTestContainer("Simple cast") { inContext(ExpressionParsingCtx) { - "(Foo) obj" should parseAs { castExpr { it::getCastType shouldBe classType("Foo") @@ -33,8 +30,7 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - parserTest("Nested casts") { - + parserTestContainer("Nested casts") { inContext(ExpressionParsingCtx) { "(Foo) (int) obj" should parseAs { castExpr { @@ -48,8 +44,7 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - parserTest("Test intersection in cast", javaVersions = JavaVersion.J1_8..Latest) { - + parserTestContainer("Test intersection in cast", javaVersions = JavaVersion.J1_8..Latest) { inContext(ExpressionParsingCtx) { "(@F Foo & Bar) obj" should parseAs { @@ -72,7 +67,6 @@ class ASTCastExpressionTest : ParserTestSpec({ } "(@F Foo & @B@C Bar) obj" should parseAs { - castExpr { it::getCastType shouldBe child { @@ -94,10 +88,8 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - parserTest("Test intersection ambiguity", javaVersions = Earliest..Latest) { + parserTestContainer("Test intersection ambiguity", javaVersions = Earliest..Latest) { inContext(ExpressionParsingCtx) { - - "(modifiers & InputEvent.Foo) != 0" should parseAs { infixExpr(BinaryOp.NE) { parenthesized { @@ -113,7 +105,6 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - "(modifiers) != 0" should parseAs { infixExpr(BinaryOp.NE) { parenthesized { @@ -124,7 +115,6 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - "(modifiers) * 0" should parseAs { infixExpr(BinaryOp.MUL) { parenthesized { @@ -137,8 +127,6 @@ class ASTCastExpressionTest : ParserTestSpec({ } } - - }) val Annotatable.declaredAnnotationsList: List diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt index 4039461e8e..7e4a8edd8d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTCatchClauseTest.kt @@ -13,25 +13,18 @@ import java.io.IOException class ASTCatchClauseTest : ParserTestSpec({ - - parserTest("Test crash on multicatch", javaVersions = Earliest..J1_6) { - - + parserTestContainer("Test crash on multicatch", javaVersions = Earliest..J1_6) { inContext(StatementParsingCtx) { - "try { } catch (IOException | AssertionError e) { }" should throwParseException { it.message.shouldContain("Composite catch clauses are a feature of Java 1.7, you should select your language version accordingly") } - } } - parserTest("Test single type", javaVersions = J1_5..Latest) { - + parserTestContainer("Test single type", javaVersions = J1_5..Latest) { importedTypes += IOException::class.java inContext(StatementParsingCtx) { - "try { } catch (IOException ioe) { }" should parseAs { tryStmt { it::getBody shouldBe block { } @@ -51,11 +44,10 @@ class ASTCatchClauseTest : ParserTestSpec({ } } - parserTest("Test multicatch", javaVersions = J1_7..Latest) { - + parserTestContainer("Test multicatch", javaVersions = J1_7..Latest) { importedTypes += IOException::class.java - inContext(StatementParsingCtx) { + inContext(StatementParsingCtx) { "try { } catch (IOException | AssertionError e) { }" should parseAs { tryStmt { it::getBody shouldBe block { } @@ -73,17 +65,14 @@ class ASTCatchClauseTest : ParserTestSpec({ variableId("e") } - it::getBody shouldBe block { } } } } - } } - parserTest("Test annotated multicatch", javaVersions = J1_8..Latest) { - + parserTestContainer("Test annotated multicatch", javaVersions = J1_8..Latest) { importedTypes += IOException::class.java inContext(StatementParsingCtx) { @@ -114,6 +103,4 @@ class ASTCatchClauseTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt index 9ca8a75c99..ded34ddb40 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassDeclarationTest.kt @@ -8,11 +8,8 @@ package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTClassDeclarationTest : ParserTestSpec({ - - parserTest("Local classes") { - + parserTestContainer("Local classes") { inContext(StatementParsingCtx) { - """ @F class Local { @@ -86,6 +83,4 @@ class ASTClassDeclarationTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt index 6a1276e645..2d71778fc1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTClassLiteralTest.kt @@ -12,17 +12,12 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* * @since 7.0.0 */ class ASTClassLiteralTest : ParserTestSpec({ - - parserTest("Class literals") { - + parserTestContainer("Class literals") { inContext(ExpressionParsingCtx) { - - "void.class" should parseAs { classLiteral { voidType() } } - "int.class" should parseAs { classLiteral { primitiveType(INT) @@ -35,7 +30,6 @@ class ASTClassLiteralTest : ParserTestSpec({ } } - "int[].class" should parseAs { classLiteral { arrayType { @@ -47,15 +41,10 @@ class ASTClassLiteralTest : ParserTestSpec({ } } - "List.class" shouldNot parse() "Map.class" shouldNot parse() "java.util.List.class" should parse() "java.util.@F List.class" shouldNot parse() - } - - } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt index 5077fdfa89..7797773112 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorCallTest.kt @@ -8,9 +8,7 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.ASTAssignableExpr.AccessType.READ class ASTConstructorCallTest : ParserTestSpec({ - - parserTest("Class instance creation") { - + parserTestContainer("Class instance creation") { inContext(ExpressionParsingCtx) { "new Foo(a)" should parseAs { constructorCall { @@ -63,7 +61,7 @@ class ASTConstructorCallTest : ParserTestSpec({ } } - parserTest("Qualified class instance auto disambiguation") { + parserTestContainer("Qualified class instance auto disambiguation") { /* JLS: * A name is syntactically classified as an ExpressionName in these contexts: * ... @@ -109,8 +107,7 @@ class ASTConstructorCallTest : ParserTestSpec({ } } - parserTest("Qualified class instance creation") { - + parserTestContainer("Qualified class instance creation") { inContext(ExpressionParsingCtx) { "new O().new Foo()" should parseAs { constructorCall { @@ -159,5 +156,4 @@ class ASTConstructorCallTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt index aa0d9bc631..85e25c2e14 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclarationTest.kt @@ -9,11 +9,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTConstructorDeclarationTest : ParserTestSpec({ - - parserTest("Receiver parameters") { - + parserTestContainer("Receiver parameters") { inContext(TypeBodyParsingCtx) { - "Foo(@A Foo this){}" should parseAs { constructorDecl { it::getName shouldBe "Foo" @@ -60,8 +57,6 @@ class ASTConstructorDeclarationTest : ParserTestSpec({ variableId("other") } ) - - } it::getThrowsList shouldBe null @@ -71,10 +66,8 @@ class ASTConstructorDeclarationTest : ParserTestSpec({ } } - parserTest("Annotation placement") { - + parserTestContainer("Annotation placement") { inContext(TypeBodyParsingCtx) { - "@OnDecl Foo() { return; }" should parseAs { constructorDecl { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt index 23328aa275..614b924db5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEnumConstantTest.kt @@ -11,9 +11,7 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.ast.JModifier.* class ASTEnumConstantTest : ParserTestSpec({ - - parserTest("Enum constants should have a variable declarator id") { - + parserTestContainer("Enum constants should have a variable declarator id") { inContext(TopLevelTypeDeclarationParsingCtx) { "enum Foo { A, B }" should parseAs { enumDecl("Foo") { @@ -54,14 +52,9 @@ class ASTEnumConstantTest : ParserTestSpec({ } } - - parserTest("Corner cases with separators") { - + parserTestContainer("Corner cases with separators") { inContext(TopLevelTypeDeclarationParsingCtx) { - - "enum Foo { A, }" should parseAs { - enumDecl("Foo") { modifiers { } enumBody { @@ -72,7 +65,6 @@ class ASTEnumConstantTest : ParserTestSpec({ } "enum Foo { , }" should parseAs { - enumDecl("Foo") { modifiers { } @@ -83,7 +75,6 @@ class ASTEnumConstantTest : ParserTestSpec({ } "enum Foo { ,; }" should parseAs { - enumDecl("Foo") { modifiers { } enumBody { @@ -96,7 +87,6 @@ class ASTEnumConstantTest : ParserTestSpec({ "enum Foo { ,, }" shouldNot parse() "enum Foo { ; }" should parseAs { - enumDecl("Foo") { modifiers { } enumBody { @@ -107,7 +97,6 @@ class ASTEnumConstantTest : ParserTestSpec({ } "enum Foo { ;; }" should parseAs { - enumDecl("Foo") { modifiers { } @@ -121,9 +110,7 @@ class ASTEnumConstantTest : ParserTestSpec({ } } - - parserTest("Enum constants should have an anonymous class node") { - + parserTestContainer("Enum constants should have an anonymous class node") { inContext(TopLevelTypeDeclarationParsingCtx) { "enum Foo { B { } }" should parseAs { enumDecl("Foo") { @@ -154,9 +141,7 @@ class ASTEnumConstantTest : ParserTestSpec({ } } - - parserTest("Enum constants should contain their annotations") { - + parserTestContainer("Enum constants should contain their annotations") { inContext(TopLevelTypeDeclarationParsingCtx) { "enum Foo { @C B, @A@a C }" should parseAs { enumDecl("Foo") { @@ -171,7 +156,6 @@ class ASTEnumConstantTest : ParserTestSpec({ c::declaredAnnotationsList shouldBe listOf(annotation("C")) } - it::getVarId shouldBe variableId("B") it::getArguments shouldBe null @@ -179,15 +163,12 @@ class ASTEnumConstantTest : ParserTestSpec({ } enumConstant("C") { - - val c = it it::getModifiers shouldBe modifiers { c::declaredAnnotationsList shouldBe listOf(annotation("A"), annotation("a")) } - it::getVarId shouldBe variableId("C") it::getArguments shouldBe null @@ -199,9 +180,7 @@ class ASTEnumConstantTest : ParserTestSpec({ } } - - parserTest("Enum constants with arguments") { - + parserTestContainer("Enum constants with arguments") { inContext(TopLevelTypeDeclarationParsingCtx) { "enum Foo { B(\"str\") }" should parseAs { enumDecl("Foo") { @@ -237,7 +216,6 @@ class ASTEnumConstantTest : ParserTestSpec({ it::getModifiers shouldBe modifiers {} - enumBody { enumConstant("B") { @@ -262,5 +240,4 @@ class ASTEnumConstantTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEqualityExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEqualityExpressionTest.kt index 2a4343178b..8c835739da 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEqualityExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTEqualityExpressionTest.kt @@ -8,11 +8,8 @@ import net.sourceforge.pmd.lang.java.ast.BinaryOp.* class ASTEqualityExpressionTest : ParserTestSpec({ - - parserTest("Test equality expressions") { - + parserTestContainer("Test equality expressions") { inContext(ExpressionParsingCtx) { - "1 == 2 == 3" should parseAs { infixExpr(EQ) { infixExpr(EQ) { @@ -80,5 +77,4 @@ class ASTEqualityExpressionTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt index 2f318c9b2d..8c06017db4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTExplicitConstructorInvocationTest.kt @@ -7,14 +7,10 @@ package net.sourceforge.pmd.lang.java.ast import net.sourceforge.pmd.lang.test.ast.shouldBe class ASTExplicitConstructorInvocationTest : ParserTestSpec({ - - parserTest("Explicit this invocation") { - + parserTestContainer("Explicit this invocation") { inContext(TypeBodyParsingCtx) { - "Foo() { this(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -34,7 +30,6 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ "Foo() { this(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -59,12 +54,10 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } - parserTest("Explicit super invocation") { - + parserTestContainer("Explicit super invocation") { inContext(TypeBodyParsingCtx) { "Foo() { super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -83,9 +76,9 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } } + "Foo() { super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -109,13 +102,10 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } - - parserTest("Explicit super invocation with LHS") { - + parserTestContainer("Explicit super invocation with LHS") { inContext(TypeBodyParsingCtx) { "Foo() { o.super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -138,7 +128,6 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ "Foo() { o.super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -164,7 +153,6 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ "Foo() { o.foo().super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -187,9 +175,9 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } } + "public TabbedPaneLayout() { MetalTabbedPaneUI.this.super(); }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { it::getExplicitModifiers shouldBe setOf(JModifier.PUBLIC) } @@ -221,17 +209,14 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ // so we don't test those } - parserTest("Arguments of invocations") { - + parserTestContainer("Arguments of invocations") { inContext(TypeBodyParsingCtx) { - """ - WebSocketReceivePublisher() { - super(AbstractListenerWebSocketSession.this.getLogPrefix()); - } - """ should parseAs { + WebSocketReceivePublisher() { + super(AbstractListenerWebSocketSession.this.getLogPrefix()); + } + """ should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -261,13 +246,10 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } - parserTest("Neg tests, not explicit invocations") { - + parserTestContainer("Neg tests, not explicit invocations") { inContext(TypeBodyParsingCtx) { - "Foo() { this.name = null; }" should parseAs { constructorDecl { - it::getModifiers shouldBe modifiers { } formalsList(0) { } @@ -314,5 +296,4 @@ class ASTExplicitConstructorInvocationTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt index 60571e0731..8598715f6d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldAccessTest.kt @@ -10,11 +10,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @author Clรฉment Fournier */ class ASTFieldAccessTest : ParserTestSpec({ - - parserTest("Field access expressions") { - + parserTestContainer("Field access expressions") { inContext(ExpressionParsingCtx) { - "Type.this.foo" should parseAs { fieldAccess("foo") { @@ -36,10 +33,8 @@ class ASTFieldAccessTest : ParserTestSpec({ } } - "a.b.c" should parseAs { fieldAccess("c") { - val fieldAccess = it it::getQualifier shouldBe child { @@ -50,7 +45,6 @@ class ASTFieldAccessTest : ParserTestSpec({ } } - "a" should parseAs { variableAccess("a") } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt index 247a1da412..c6d535c79a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclarationTest.kt @@ -11,11 +11,8 @@ import net.sourceforge.pmd.lang.test.ast.textOfReportLocation import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTFieldDeclarationTest : ParserTestSpec({ - - parserTest("Extra dimensions") { - + parserTestContainer("Extra dimensions") { inContext(TypeBodyParsingCtx) { - // int x[][] = null; // int[] x[][] = null; @@ -48,12 +45,10 @@ class ASTFieldDeclarationTest : ParserTestSpec({ } } - parserTest("In annotation") { - + parserTestContainer("In annotation") { genClassHeader = "@interface A" inContext(TypeBodyParsingCtx) { - // int x[][] = null; // int[] x[][] = null; @@ -88,5 +83,4 @@ class ASTFieldDeclarationTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt index 3c3a4682e3..bbe0d9ccda 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTInstanceOfExpressionTest.kt @@ -9,11 +9,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind class ASTInstanceOfExpressionTest : ParserTestSpec({ - - parserTest("InstanceofExpression can be annotated") { - + parserTestContainer("InstanceofExpression can be annotated") { inContext(ExpressionParsingCtx) { - "f instanceof @A K" should parseAs { infixExpr(BinaryOp.INSTANCEOF) { it::getLeftOperand shouldBe variableAccess("f") @@ -27,10 +24,8 @@ class ASTInstanceOfExpressionTest : ParserTestSpec({ } } - parserTest("Instanceof with pattern") { - + parserTestContainer("Instanceof with pattern") { inContext(ExpressionParsingCtx) { - "o instanceof String s && s.length() > 4" should parseAs { infixExpr(BinaryOp.CONDITIONAL_AND) { infixExpr(BinaryOp.INSTANCEOF) { @@ -52,8 +47,7 @@ class ASTInstanceOfExpressionTest : ParserTestSpec({ } } - parserTest("InstanceofExpression cannot test primitive types") { - + parserTestContainer("InstanceofExpression cannot test primitive types") { inContext(ExpressionParsingCtx) { PrimitiveTypeKind.values().map { it.simpleName }.forEach { "f instanceof $it" shouldNot parse() @@ -61,5 +55,4 @@ class ASTInstanceOfExpressionTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt index 9be4a6400e..74135cd3fb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLambdaExpressionTest.kt @@ -11,16 +11,10 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* class ASTLambdaExpressionTest : ParserTestSpec({ - - parserTest("Simple lambda expressions", javaVersions = J1_8..Latest) { - + parserTestContainer("Simple lambda expressions", javaVersions = J1_8..Latest) { inContext(ExpressionParsingCtx) { - - "a -> foo()" should parseAs { exprLambda { - - it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") { it::isTypeInferred shouldBe true @@ -29,15 +23,12 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } - methodCall("foo") } } "(a,b) -> foo()" should parseAs { exprLambda { - - it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") { it::isTypeInferred shouldBe true @@ -50,28 +41,23 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } } - - methodCall("foo") } } "(a,b) -> { foo(); } " should parseAs { blockLambda { - it::getParameters shouldBe lambdaFormals { simpleLambdaParam("a") simpleLambdaParam("b") } - block() } } "(final int a, @F List b) -> foo()" should parseAs { exprLambda { - it::getParameters shouldBe lambdaFormals { lambdaParam { it::getModifiers shouldBe modifiers { @@ -101,20 +87,16 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } } - methodCall("foo") } } } } - parserTest("Mixed array notation/varargs", javaVersions = J1_8..Latest) { - + parserTestContainer("Mixed array notation/varargs", javaVersions = J1_8..Latest) { inContext(ExpressionParsingCtx) { "(final int a[]@B[], @F List@a [] b @A []) -> foo()" should parseAs { - exprLambda { - it::getParameters shouldBe child { lambdaParam { it::getModifiers shouldBe modifiers { @@ -166,20 +148,16 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } } - methodCall("foo") } } } } - parserTest("Varargs parameter", javaVersions = J1_8..Latest) { - + parserTestContainer("Varargs parameter", javaVersions = J1_8..Latest) { inContext(ExpressionParsingCtx) { "(String ... b) -> {}" should parseAs { - blockLambda { - it::getParameters shouldBe child { lambdaParam { it::getModifiers shouldBe modifiers {} @@ -196,15 +174,12 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } } - block { } } } "(String @A [] @B ... b) -> {}" should parseAs { - blockLambda { - it::getParameters shouldBe child { lambdaParam { it::getModifiers shouldBe modifiers {} @@ -227,24 +202,21 @@ class ASTLambdaExpressionTest : ParserTestSpec({ } } - block { } } } } } - parserTest("Negative lambda contexts") { + parserTestContainer("Negative lambda contexts") { inContext(StatementParsingCtx) { "a -> {}" shouldNot parse() } } - parserTest("Positive lambda contexts") { - + parserTestContainer("Positive lambda contexts") { inContext(ExpressionParsingCtx) { "(a -> {})" should parse() } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt index 13de3376c1..c7fecfa2dc 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt @@ -22,11 +22,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldHaveText * @since 7.0.0 */ class ASTLiteralTest : ParserTestSpec({ - - parserTest("String literal") { - + parserTestContainer("String literal") { inContext(ExpressionParsingCtx) { - "\"\"" should parseAs { stringLit("\"\"") { it::getConstValue shouldBe "" @@ -57,17 +54,12 @@ class ASTLiteralTest : ParserTestSpec({ } } - parserTest("Text block literal", javaVersions = since(J15)) { - + parserTestContainer("Text block literal", javaVersions = since(J15)) { val delim = "\"\"\"" inContext(ExpressionParsingCtx) { - - suspend fun String.testTextBlock(contents: NodeSpec = EmptyAssertions) { - this should parseAs { - textBlock { it.literalText.toString() shouldBe this@testTextBlock.trim() contents() @@ -145,13 +137,10 @@ $delim } - - parserTest("Text block literal on non-JDK13 preview", javaVersions = Earliest.rangeTo(J14)) { - + parserTestContainer("Text block literal on non-JDK13 preview", javaVersions = Earliest.rangeTo(J14)) { val delim = "\"\"\"" inContext(ExpressionParsingCtx) { - """ $delim @@ -169,14 +158,10 @@ $delim """ shouldNot parse() } - } - - - parserTest("String literal escapes") { + parserTestContainer("String literal escapes") { inContext(ExpressionParsingCtx) { - "\"abc\u1234abc\"" should parseAs { stringLit("\"abc\u1234abc\"") { it::getConstValue shouldBe "abc\u1234abc" @@ -198,7 +183,7 @@ $delim } } - parserTest("String literal octal escapes") { + parserTestContainer("String literal octal escapes") { inContext(ExpressionParsingCtx) { // (kotlin doesn't have octal escapes) val char = "123".toInt(radix = 8).toChar() @@ -219,15 +204,11 @@ $delim it::getConstValue shouldBe char.toString() + "\n" } } - } } - - - parserTest("Char literal") { + parserTestContainer("Char literal") { inContext(ExpressionParsingCtx) { - "'c'" should parseAs { charLit("'c'") { it::getConstValue shouldBe 'c' @@ -254,9 +235,8 @@ $delim } } - parserTest("Boolean literals") { + parserTestContainer("Boolean literals") { inContext(ExpressionParsingCtx) { - "true" should parseAs { boolean(true) } @@ -267,7 +247,7 @@ $delim } } - parserTest("Null literal") { + parserTestContainer("Null literal") { inContext(ExpressionParsingCtx) { "null" should parseAs { nullLit() @@ -275,9 +255,8 @@ $delim } } - parserTest("Numeric literals") { + parserTestContainer("Numeric literals") { inContext(ExpressionParsingCtx) { - "12" should parseAs { number(INT) { it::getValueAsInt shouldBe 12 @@ -411,14 +390,12 @@ $delim } } - parserTest("Hex floating point literals") { - + parserTestContainer("Hex floating point literals") { // the exponent is binary: // p1 multiplies by 2 // p-1 divides by 2 inContext(ExpressionParsingCtx) { - val exp30f: NodeSpec<*> = { number(FLOAT) { it::getValueAsDouble shouldBe 30.0 @@ -427,7 +404,6 @@ $delim } } - "0x0fp1f" should parseAs(exp30f) @Suppress("LocalVariableName") @@ -447,11 +423,8 @@ $delim } } - parserTest("Hex integral literals") { - - + parserTestContainer("Hex integral literals") { inContext(ExpressionParsingCtx) { - fun hex15(type: PrimitiveTypeKind): ValuedNodeSpec<*, ASTNumericLiteral> = { number(type) { it::getValueAsDouble shouldBe 15.0 @@ -484,46 +457,40 @@ $delim } } - parserTestGroup("Binary numeric literals") { + parserTestContainer("Binary numeric literals - pre java1.7", javaVersions = Earliest..J1_6) { + // binary literals were introduced in 1.7 - onVersions(Earliest..J1_6) { - // binary literals were introduced in 1.7 + inContext(ExpressionParsingCtx) { + "0b011" shouldNot parse() + "0B011" shouldNot parse() + "0B0_1__1" shouldNot parse() - inContext(ExpressionParsingCtx) { - - "0b011" shouldNot parse() - "0B011" shouldNot parse() - "0B0_1__1" shouldNot parse() - - "0B0_1__1l" shouldNot parse() - "0b0_11L" shouldNot parse() - - } - } - - onVersions(J1_7..Latest) { - fun binaryThree(type: PrimitiveTypeKind): NodeSpec<*> = { - number(type) { - it::getValueAsDouble shouldBe 3.0 - it::getValueAsFloat shouldBe 3f - it::getValueAsInt shouldBe 3 - it::getValueAsLong shouldBe 3L - } - } - - inContext(ExpressionParsingCtx) { - "0b011" should parseAs(binaryThree(INT)) - "0B011" should parseAs(binaryThree(INT)) - "0B0_1__1" should parseAs(binaryThree(INT)) - - "0B0_1__1l" should parseAs(binaryThree(LONG)) - "0b0_11L" should parseAs(binaryThree(LONG)) - - "0b05" shouldNot parse() - "0b_1" shouldNot parse() - "0b1_" shouldNot parse() - } + "0B0_1__1l" shouldNot parse() + "0b0_11L" shouldNot parse() } } + parserTestContainer("Binary numeric literals - java1.7+", javaVersions = J1_7..Latest) { + fun binaryThree(type: PrimitiveTypeKind): NodeSpec<*> = { + number(type) { + it::getValueAsDouble shouldBe 3.0 + it::getValueAsFloat shouldBe 3f + it::getValueAsInt shouldBe 3 + it::getValueAsLong shouldBe 3L + } + } + + inContext(ExpressionParsingCtx) { + "0b011" should parseAs(binaryThree(INT)) + "0B011" should parseAs(binaryThree(INT)) + "0B0_1__1" should parseAs(binaryThree(INT)) + + "0B0_1__1l" should parseAs(binaryThree(LONG)) + "0b0_11L" should parseAs(binaryThree(LONG)) + + "0b05" shouldNot parse() + "0b_1" shouldNot parse() + "0b1_" shouldNot parse() + } + } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt index 064f8fd8a2..25f3f04e15 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclarationTest.kt @@ -9,11 +9,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTLocalVariableDeclarationTest : ParserTestSpec({ - - parserTest("Extra dimensions") { - + parserTestContainer("Extra dimensions") { inContext(StatementParsingCtx) { - // int x[][] = null; // int[] x[][] = null; @@ -40,5 +37,4 @@ class ASTLocalVariableDeclarationTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt index a08cbf76df..d926f64acf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodCallTest.kt @@ -11,64 +11,48 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @since 7.0.0 */ class ASTMethodCallTest : ParserTestSpec({ - - - parserTest("Method call expressions") { - + parserTestContainer("Method call expressions") { inContext(ExpressionParsingCtx) { - "Type.this.foo()" should parseAs { methodCall("foo") { - it::getQualifier shouldBe thisExpr { classType("Type") } - it::getArguments shouldBe argList {} } } "foo().bar()" should parseAs { methodCall("bar") { - it::getQualifier shouldBe child { it::getMethodName shouldBe "foo" - it::getQualifier shouldBe null - it::getArguments shouldBe argList {} } - it::getArguments shouldBe argList {} } } "foo.bar.baz()" should parseAs { methodCall("baz") { - it::getQualifier shouldBe child { it::getName shouldBe "foo.bar" } - it::getArguments shouldBe argList {} } } + "foo.f()" should parseAs { methodCall("f") { - it::getQualifier shouldBe ambiguousName("foo") - it::getExplicitTypeArguments shouldBe typeArgList { classType("B") } - it::getArguments shouldBe argList { } } } "foo.bar(e->it.f(e))" should parseAs { methodCall("bar") { - it::getQualifier shouldBe ambiguousName("foo") - it::getArguments shouldBe argList { child(ignoreChildren = true) {} } @@ -76,20 +60,15 @@ class ASTMethodCallTest : ParserTestSpec({ } "foo.bar(foo::bar).foreach(System.out::println)" should parseAs { - methodCall("foreach") { - it::getQualifier shouldBe methodCall("bar") { - it::getQualifier shouldBe ambiguousName("foo") - it::getArguments shouldBe argList { methodRef("bar") { ambiguousName("foo") } } } - it::getArguments shouldBe argList { methodRef("println") { ambiguousName("System.out") @@ -99,6 +78,4 @@ class ASTMethodCallTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt index 3702e4b924..21bb2758a1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarationTest.kt @@ -19,13 +19,10 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTMethodDeclarationTest : ParserTestSpec({ - - parserTest("Non-private interfaces members should be public", javaVersions = Earliest..Latest) { - + parserTestContainer("Non-private interfaces members should be public", javaVersions = Earliest..Latest) { genClassHeader = "interface Bar" inContext(TypeBodyParsingCtx) { - "int foo();" should parseAs { methodDecl { it should haveVisibility(V_PUBLIC) @@ -74,8 +71,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Private methods in interface should be private", J9..Latest) { - + parserTestContainer("Private methods in interface should be private", J9..Latest) { inContext(TypeBodyParsingCtx) { "private int de() { return 1; }" should parseAs { methodDecl { @@ -86,25 +82,21 @@ class ASTMethodDeclarationTest : ParserTestSpec({ it should haveModifier(PRIVATE) it.textOfReportLocation() shouldBe "de" - unspecifiedChildren(4) } } } } - parserTest("Non-default methods in interfaces should be abstract", javaVersions = J1_8..Latest) { - + parserTestContainer("Non-default methods in interfaces should be abstract", javaVersions = J1_8..Latest) { genClassHeader = "interface Bar" inContext(TypeBodyParsingCtx) { - "int bar();" should parseAs { methodDecl { it shouldNot haveModifier(DEFAULT) it should haveModifier(ABSTRACT) - unspecifiedChildren(3) } } @@ -114,16 +106,13 @@ class ASTMethodDeclarationTest : ParserTestSpec({ it shouldNot haveModifier(DEFAULT) it should haveModifier(ABSTRACT) - unspecifiedChildren(3) } } - } } - parserTest("Default methods in interfaces should not be abstract", javaVersions = J1_8..Latest) { - + parserTestContainer("Default methods in interfaces should not be abstract", javaVersions = J1_8..Latest) { genClassHeader = "interface Bar" inContext(TypeBodyParsingCtx) { @@ -132,7 +121,6 @@ class ASTMethodDeclarationTest : ParserTestSpec({ it should haveModifier(DEFAULT) it shouldNot haveModifier(ABSTRACT) - unspecifiedChildren(4) } } @@ -141,10 +129,8 @@ class ASTMethodDeclarationTest : ParserTestSpec({ // default abstract is an invalid combination of modifiers, so we won't encounter it in real analysis } - parserTest("Throws list") { - + parserTestContainer("Throws list") { inContext(TypeBodyParsingCtx) { - "void bar() throws IOException, java.io.Bar { }" should parseAs { methodDecl { it::isAbstract shouldBe false @@ -157,7 +143,6 @@ class ASTMethodDeclarationTest : ParserTestSpec({ it::getResultTypeNode shouldBe voidType() - it::getFormalParameters shouldBe formalsList(0) it::getThrowsList shouldBe throwsList { @@ -173,13 +158,10 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Throws list can be annotated") { - + parserTestContainer("Throws list can be annotated") { inContext(TypeBodyParsingCtx) { - "void bar() throws @Oha IOException, @Aha java.io.@Oha Bar { }" should parseAs { methodDecl { - it::getModifiers shouldBe modifiers { } it::getResultTypeNode shouldBe voidType() @@ -207,13 +189,10 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Varargs can be annotated") { - + parserTestContainer("Varargs can be annotated") { inContext(TypeBodyParsingCtx) { "void bar(@Oha IOException @Aha ... java) { }" should parseAs { - methodDecl { - it::getModifiers shouldBe modifiers { } it::getResultTypeNode shouldBe voidType() @@ -243,9 +222,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({ "void bar(@Oha IOException []@O[] @Aha ... java) { }" should parseAs { - methodDecl { - it::getModifiers shouldBe modifiers { } it::getResultTypeNode shouldBe voidType() @@ -278,13 +255,10 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Extra dimensions can be annotated") { - + parserTestContainer("Extra dimensions can be annotated") { inContext(TypeBodyParsingCtx) { "void bar() [] @O[] { }" should parseAs { - methodDecl { - it::getModifiers shouldBe modifiers { } it::getResultTypeNode shouldBe voidType() @@ -304,12 +278,10 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Annotation methods") { - + parserTestContainer("Annotation methods") { genClassHeader = "@interface Foo" inContext(TypeBodyParsingCtx) { - "Bar bar() throws IOException;" shouldNot parse() "void bar();" shouldNot parse() "default int bar() { return 1; }" shouldNot parse() @@ -332,7 +304,6 @@ class ASTMethodDeclarationTest : ParserTestSpec({ it::getDefaultClause shouldBe defaultValue { int(2) } } } - "int bar() @NonZero [];" should parseAs { annotationMethod { it::getModifiers shouldBe modifiers { } @@ -379,8 +350,7 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Receiver parameters") { - + parserTestContainer("Receiver parameters") { /* Notice the parameterCount is 0 - receiver parameters don't affect arity. */ @@ -435,16 +405,14 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - it.toList() shouldBe listOf( - child { - localVarModifiers { } - primitiveType(INT) - variableId("other") - } - ) - - - } + it.toList() shouldBe listOf( + child { + localVarModifiers { } + primitiveType(INT) + variableId("other") + } + ) + } it::getThrowsList shouldBe null it::getBody shouldBe null @@ -453,12 +421,10 @@ class ASTMethodDeclarationTest : ParserTestSpec({ } } - parserTest("Annotation placement") { + parserTestContainer("Annotation placement") { inContext(TypeBodyParsingCtx) { - "@OnDecl @OnType Ret bar() { return; }" should parseAs { methodDecl { - it::getName shouldBe "bar" it::getModifiers shouldBe modifiers { @@ -475,7 +441,6 @@ class ASTMethodDeclarationTest : ParserTestSpec({ annotation("OnType") } - formalsList(0) block() } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt index 97791223ea..6706c2e06e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMethodReferenceTest.kt @@ -14,13 +14,9 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* * @since 7.0.0 */ class ASTMethodReferenceTest : ParserTestSpec({ - - parserTest("Method reference") { - + parserTestContainer("Method reference") { inContext(ExpressionParsingCtx) { - "this::foo" should parseAs { - methodRef("foo") { it::getExplicitTypeArguments shouldBe null @@ -29,7 +25,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ } "foobar.b::foo" should parseAs { - methodRef("foo") { it::getExplicitTypeArguments shouldBe null @@ -38,7 +33,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ } "foobar.b::foo" should parseAs { - methodRef("foo") { it::getQualifier shouldBe ambiguousName("foobar.b") @@ -50,7 +44,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ "foobar.b::foo" should parseAs { - methodRef("foo") { it::getExplicitTypeArguments shouldBe null @@ -70,7 +63,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ } "java.util.Map.Entry::foo" should parseAs { - methodRef("foo") { it::getQualifier shouldBe typeExpr { classType("Entry") // ignore the rest @@ -98,22 +90,16 @@ class ASTMethodReferenceTest : ParserTestSpec({ } } - parserTest("Neg tests") { - + parserTestContainer("Neg tests") { inContext(ExpressionParsingCtx) { - "foo::bar::bar" shouldNot parse() "foo::bar.foo()" shouldNot parse() "foo::bar.foo" shouldNot parse() - } - } - parserTest("Constructor reference") { - + parserTestContainer("Constructor reference") { inContext(ExpressionParsingCtx) { - "foobar.b::new" should parseAs { constructorRef { it::getExplicitTypeArguments shouldBe null @@ -130,7 +116,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ constructorRef { it::getExplicitTypeArguments shouldBe null - typeExpr { classType("b") { it::getAmbiguousLhs shouldBe ambiguousName("foobar") @@ -208,10 +193,8 @@ class ASTMethodReferenceTest : ParserTestSpec({ } } - parserTest("Type annotations") { - + parserTestContainer("Type annotations") { inContext(ExpressionParsingCtx) { - "@Vernal Date::getDay" should parseAs { methodRef(methodName = "getDay") { it::getQualifier shouldBe typeExpr { @@ -235,7 +218,6 @@ class ASTMethodReferenceTest : ParserTestSpec({ annotation("Vernal") } } - it::getExplicitTypeArguments shouldBe null } } @@ -245,6 +227,5 @@ class ASTMethodReferenceTest : ParserTestSpec({ }) - fun ASTClassType.getAmbiguousLhs(): ASTAmbiguousName? = children(ASTAmbiguousName::class.java).first() diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt index 02431494de..a216cb3bfe 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTModuleDeclarationTest.kt @@ -19,20 +19,16 @@ import net.sourceforge.pmd.lang.java.symbols.JClassSymbol * @since 7.0.0 */ class ASTModuleDeclarationTest : ParserTestSpec({ - parserTest("Test annotations on module", javaVersions = since(J9)) { - doTest { - val root: ASTCompilationUnit = parser.withProcessing(true).parse("@A @a.B module foo { } ") - root.moduleDeclaration.shouldMatchNode { - it.getAnnotation("A") shouldBe annotation("A") - it.getAnnotation("a.B") shouldBe annotation("B") - modName("foo") - } + val root: ASTCompilationUnit = parser.withProcessing(true).parse("@A @a.B module foo { } ") + root.moduleDeclaration.shouldMatchNode { + it.getAnnotation("A") shouldBe annotation("A") + it.getAnnotation("a.B") shouldBe annotation("B") + modName("foo") } } - parserTest("opens decl") { - + parserTestContainer("opens decl") { inContext(ModuleDirectiveParsingContext) { "opens a.package_ to a.module_;" should parseAs { child { @@ -58,8 +54,7 @@ class ASTModuleDeclarationTest : ParserTestSpec({ } } - parserTest("exports decl") { - + parserTestContainer("exports decl") { inContext(ModuleDirectiveParsingContext) { "exports a.package_ to a.module_;" should parseAs { child { @@ -85,8 +80,7 @@ class ASTModuleDeclarationTest : ParserTestSpec({ } } - parserTest("Test uses") { - + parserTestContainer("Test uses") { inContext(ModuleDirectiveParsingContext) { "uses a.clazz.Name;" should parseAs { child { @@ -95,8 +89,8 @@ class ASTModuleDeclarationTest : ParserTestSpec({ } } } - parserTest("Test provides") { + parserTestContainer("Test provides") { inContext(ModuleDirectiveParsingContext) { enableProcessing() "provides an.Itf with imp1.Impl;" should parseAs { @@ -112,7 +106,6 @@ class ASTModuleDeclarationTest : ParserTestSpec({ } } } - }) fun TreeNodeWrapper.modName(name: String, assertions: NodeSpec = EmptyAssertions) = diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMultiplicativeExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMultiplicativeExpressionTest.kt index 3b78473f7a..6eeeedfee3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMultiplicativeExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTMultiplicativeExpressionTest.kt @@ -9,9 +9,7 @@ import net.sourceforge.pmd.lang.java.ast.UnaryOp.UNARY_MINUS class ASTMultiplicativeExpressionTest : ParserTestSpec({ - - parserTest("Simple multiplicative expression should be flat") { - + parserTestContainer("Simple multiplicative expression should be flat") { inContext(ExpressionParsingCtx) { "1 * 2 * 3" should parseAs { infixExpr(MUL) { @@ -47,9 +45,8 @@ class ASTMultiplicativeExpressionTest : ParserTestSpec({ } } - parserTest("Changing operators should push a new node") { + parserTestContainer("Changing operators should push a new node") { inContext(ExpressionParsingCtx) { - "1 * 2 / 3 % 2" should parseAs { infixExpr(MOD) { infixExpr(DIV) { @@ -64,5 +61,4 @@ class ASTMultiplicativeExpressionTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt index b9ba5114a4..30460e35e5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTPatternTest.kt @@ -9,10 +9,9 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J16 import java.io.IOException class ASTPatternTest : ProcessorTestSpec({ - val typePatternsVersions = JavaVersion.since(J16) - parserTest("Test patterns only available on JDK16 or higher (including preview)", + parserTestContainer("Test patterns only available on JDK16 or higher (including preview)", javaVersions = JavaVersion.except(typePatternsVersions)) { inContext(ExpressionParsingCtx) { @@ -20,11 +19,10 @@ class ASTPatternTest : ProcessorTestSpec({ } } - parserTest("Test simple patterns", javaVersions = typePatternsVersions) { - + parserTestContainer("Test simple patterns", javaVersions = typePatternsVersions) { importedTypes += IOException::class.java - inContext(ExpressionParsingCtx) { + inContext(ExpressionParsingCtx) { "obj instanceof Class c" should parseAs { infixExpr(BinaryOp.INSTANCEOF) { variableAccess("obj") diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpressionTest.kt index 7e76b9497a..90eb512b6d 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTRelationalExpressionTest.kt @@ -6,10 +6,7 @@ package net.sourceforge.pmd.lang.java.ast class ASTRelationalExpressionTest : ParserTestSpec({ - - - parserTest("Relational expressions operator") { - + parserTestContainer("Relational expressions operator") { inContext(ExpressionParsingCtx) { "b < 3" should parseAs { infixExpr(BinaryOp.LT) { @@ -18,7 +15,6 @@ class ASTRelationalExpressionTest : ParserTestSpec({ } } - "a <= 3" should parseAs { infixExpr(BinaryOp.LE) { variableAccess("a") @@ -42,11 +38,9 @@ class ASTRelationalExpressionTest : ParserTestSpec({ } } - parserTest("Relational expressions precedence") { + parserTestContainer("Relational expressions precedence") { inContext(ExpressionParsingCtx) { - "1 < 3 instanceof Boolean" should parseAs { - infixExpr(BinaryOp.INSTANCEOF) { infixExpr(BinaryOp.LT) { int(1) @@ -71,7 +65,6 @@ class ASTRelationalExpressionTest : ParserTestSpec({ } "1 < 3 + 4 instanceof Boolean" should parseAs { - infixExpr(BinaryOp.INSTANCEOF) { infixExpr(BinaryOp.LT) { @@ -90,5 +83,4 @@ class ASTRelationalExpressionTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTShiftExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTShiftExpressionTest.kt index 3024ca8de2..37ec056c86 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTShiftExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTShiftExpressionTest.kt @@ -13,11 +13,8 @@ import net.sourceforge.pmd.lang.java.ast.BinaryOp.* * @since 7.0.0 */ class ASTShiftExpressionTest : ParserTestSpec({ - - parserTest("Simple shift expressions") { - + parserTestContainer("Simple shift expressions") { inContext(ExpressionParsingCtx) { - "1 >> 2" should parseAs { infixExpr(RIGHT_SHIFT) { int(1) @@ -86,9 +83,8 @@ class ASTShiftExpressionTest : ParserTestSpec({ } } - parserTest("Unary expression precedence") { + parserTestContainer("Unary expression precedence") { inContext(ExpressionParsingCtx) { - "2 >> 2 < 3" should parseAs { infixExpr(LT) { infixExpr(RIGHT_SHIFT) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt index a0d0284216..dcbe868de6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTStatementsTest.kt @@ -9,17 +9,13 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTStatementsTest : ParserTestSpec({ - - parserTest("Foreach loop") { - + parserTestContainer("Foreach loop") { inContext(StatementParsingCtx) { """ for (Integer i : new Iter<>()) loop(); """ should parseAs { - foreachLoop { - it::getVarId shouldBe fromChild { it::getModifiers shouldBe modifiers {} @@ -40,15 +36,14 @@ class ASTStatementsTest : ParserTestSpec({ } } } + """ for (@Nullable final Integer i : new Iter<>()) { continue; } """ should parseAs { - foreachLoop { - val foreach = it localVarDecl { @@ -73,10 +68,8 @@ class ASTStatementsTest : ParserTestSpec({ } } - - parserTest("For loop") { + parserTestContainer("For loop") { inContext(StatementParsingCtx) { - "for (;;) {}" should parseAs { forLoop { it::getInit shouldBe null @@ -138,10 +131,8 @@ class ASTStatementsTest : ParserTestSpec({ } } - parserTest("Blocks") { - + parserTestContainer("Blocks") { inContext(StatementParsingCtx) { - """ { for (;;) {} @@ -158,10 +149,8 @@ class ASTStatementsTest : ParserTestSpec({ } } - parserTest("Labeled statements") { - + parserTestContainer("Labeled statements") { inContext(StatementParsingCtx) { - """ { l: for (;;) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt index 112d98edc6..4a366e8dfe 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSuperExpressionTest.kt @@ -11,9 +11,7 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @since 7.0.0 */ class ASTSuperExpressionTest : ParserTestSpec({ - - parserTest("Unqualified super") { - + parserTestContainer("Unqualified super") { inContext(ExpressionParsingCtx) { "super.foo()" should parseAs { methodCall("foo") { @@ -25,7 +23,7 @@ class ASTSuperExpressionTest : ParserTestSpec({ } } - parserTest("Neg cases") { + parserTestContainer("Neg cases") { inContext(ExpressionParsingCtx) { // single super should be followed by either // a method call, field access, or method reference @@ -36,15 +34,12 @@ class ASTSuperExpressionTest : ParserTestSpec({ "T.B.super.foo()" shouldNot parse() "T.@F B.super.foo()" shouldNot parse() } - } - parserTest("Qualified super") { + parserTestContainer("Qualified super") { inContext(ExpressionParsingCtx) { - "Type.super.foo()" should parseAs { methodCall("foo") { - it::getQualifier shouldBe child { it::getQualifier shouldBe classType("Type") } @@ -55,7 +50,6 @@ class ASTSuperExpressionTest : ParserTestSpec({ "net.sourceforge.pmd.lang.java.ast.ASTThisExpression.super.foo()" should parseAs { methodCall("foo") { - it::getQualifier shouldBe child { it::getQualifier shouldBe qualClassType("net.sourceforge.pmd.lang.java.ast.ASTThisExpression") { it::getTypeArguments shouldBe null diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt index 0c80b00810..acfd680fae 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpressionTests.kt @@ -18,14 +18,11 @@ import net.sourceforge.pmd.lang.java.ast.UnaryOp.UNARY_MINUS * @author Clรฉment Fournier */ class ASTSwitchExpressionTests : ParserTestSpec({ - val switchVersions = JavaVersion.since(J14) val notSwitchVersions = JavaVersion.except(switchVersions) - parserTest("No switch expr before j13 preview", javaVersions = notSwitchVersions) { + parserTestContainer("No switch expr before j13 preview", javaVersions = notSwitchVersions) { inContext(ExpressionParsingCtx) { - - """ switch (day) { case FRIDAY, SUNDAY -> 6; @@ -39,16 +36,11 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } """ shouldNot parse() } - } - parserTest("Simple switch expressions", javaVersions = switchVersions) { - - + parserTestContainer("Simple switch expressions", javaVersions = switchVersions) { inContext(ExpressionParsingCtx) { - - """ switch (day) { case FRIDAY, SUNDAY -> 6; @@ -103,12 +95,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - - - parserTest("Non-trivial labels", javaVersions = switchVersions) { + parserTestContainer("Non-trivial labels", javaVersions = switchVersions) { inContext(ExpressionParsingCtx) { - - """ switch (day) { case a + b, 4 * 2 / Math.PI -> 6; @@ -138,11 +126,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - parserTest("Switch expr precedence", javaVersions = switchVersions) { - - + parserTestContainer("Switch expr precedence", javaVersions = switchVersions) { inContext(ExpressionParsingCtx) { - "2 * switch (day) {default -> 6;}" should parseAs { infixExpr(MUL) { number() @@ -171,11 +156,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - - parserTest("Nested switch expressions", javaVersions = switchVersions) { - + parserTestContainer("Nested switch expressions", javaVersions = switchVersions) { inContext(ExpressionParsingCtx) { - """ switch (day) { case FRIDAY -> 6; @@ -186,13 +168,10 @@ class ASTSwitchExpressionTests : ParserTestSpec({ default -> 3; } """.trimIndent() should parseAs { - switchExpr { it::getTestedExpression shouldBe variableAccess("day") - it.branches.toList() shouldBe listOf( - switchArrow { switchLabel { variableAccess("FRIDAY") @@ -231,11 +210,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - - parserTest("Test yield expressions", javaVersions = JavaVersion.since(J14)) { - + parserTestContainer("Test yield expressions", javaVersions = JavaVersion.since(J14)) { inContext(ExpressionParsingCtx) { - """ switch (day) { case FRIDAY -> 6; @@ -250,9 +226,7 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } """.trimIndent() should parseAs { - switchExpr { - val outerYields = mutableListOf() it::getTestedExpression shouldBe variableAccess("day") @@ -314,10 +288,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - parserTest("Non-fallthrough nested in fallthrough", javaVersions = switchVersions) { - + parserTestContainer("Non-fallthrough nested in fallthrough", javaVersions = switchVersions) { inContext(StatementParsingCtx) { - """ switch (day) { case FRIDAY: foo(); break; @@ -370,9 +342,7 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - - parserTest("Switch statement with non-fallthrough labels", javaVersions = switchVersions) { - + parserTestContainer("Switch statement with non-fallthrough labels", javaVersions = switchVersions) { inContext(StatementParsingCtx) { """ switch (day) { @@ -381,10 +351,8 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } """ should parseAs { switchStmt { - it::getTestedExpression shouldBe variableAccess("day") - switchArrow { switchLabel { variableAccess("THURSDAY") @@ -403,8 +371,7 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } - parserTest("Fallthrough switch statement", javaVersions = Earliest..Latest) { - + parserTestContainer("Fallthrough switch statement", javaVersions = Earliest..Latest) { inContext(StatementParsingCtx) { """ switch (day) { @@ -414,7 +381,6 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } """ should parseAs { switchStmt { - val switch = it it::getTestedExpression shouldBe variableAccess("day") @@ -447,6 +413,4 @@ class ASTSwitchExpressionTests : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt index c0654423da..80900e0480 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTThisExpressionTest.kt @@ -11,16 +11,13 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @since 7.0.0 */ class ASTThisExpressionTest : ParserTestSpec({ - - parserTest("Unqualified this") { - + parserTestContainer("Unqualified this") { inContext(ExpressionParsingCtx) { "this" should parseAs { thisExpr { null } } } - } - parserTest("Qualified this") { + parserTestContainer("Qualified this") { inContext(ExpressionParsingCtx) { "Type.this" should parseAs { thisExpr { @@ -43,8 +40,7 @@ class ASTThisExpressionTest : ParserTestSpec({ } } - - parserTest("Neg cases") { + parserTestContainer("Neg cases") { inContext(ExpressionParsingCtx) { // type arguments and annotations are disallowed on the qualifier @@ -53,12 +49,8 @@ class ASTThisExpressionTest : ParserTestSpec({ } } - - - parserTest("This/cast lookahead bug in parens") { - + parserTestContainer("This/cast lookahead bug in parens") { inContext(ExpressionParsingCtx) { - """ (Set) (new Transformer() { public Object transform(final Object obj) { @@ -77,6 +69,7 @@ class ASTThisExpressionTest : ParserTestSpec({ } } } + """ (Set) (OUTER.this) """.trim() should parseAs { @@ -109,8 +102,5 @@ class ASTThisExpressionTest : ParserTestSpec({ } } } - } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt index ba6b63a95c..8b674850af 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTryStatementTest.kt @@ -14,12 +14,10 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @since 7.0.0 */ class ASTTryStatementTest : ParserTestSpec({ - parserTest("Test try with resources", javaVersions = J1_7..Latest) { + parserTestContainer("Test try with resources", javaVersions = J1_7..Latest) { inContext(StatementParsingCtx) { - "try (Foo a = 2){}" should parseAs { tryStmt { - child { child { it::isConciseResource shouldBe false @@ -47,7 +45,6 @@ class ASTTryStatementTest : ParserTestSpec({ "try (final Foo a = 2){}" should parseAs { tryStmt { - child { child { it::isConciseResource shouldBe false @@ -70,18 +67,14 @@ class ASTTryStatementTest : ParserTestSpec({ block() } - } } } - parserTest("Test concise try with resources", javaVersions = J9..Latest) { - + parserTestContainer("Test concise try with resources", javaVersions = J9..Latest) { inContext(StatementParsingCtx) { - "try (a){}" should parseAs { tryStmt { - child { child { it::isConciseResource shouldBe true @@ -95,10 +88,8 @@ class ASTTryStatementTest : ParserTestSpec({ } } - "try (a;){}" should parseAs { tryStmt { - child { child { it::isConciseResource shouldBe true @@ -112,10 +103,8 @@ class ASTTryStatementTest : ParserTestSpec({ } } - "try (a.b){}" should parseAs { tryStmt { - child { child { it::isConciseResource shouldBe true @@ -124,7 +113,6 @@ class ASTTryStatementTest : ParserTestSpec({ ambiguousName("a") } } - } block() @@ -143,5 +131,4 @@ class ASTTryStatementTest : ParserTestSpec({ "try(Foo.this) {}" should parse() } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeParametersTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeParametersTest.kt index 433c53541c..bae50b19ea 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeParametersTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeParametersTest.kt @@ -12,18 +12,14 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 * @since 7.0.0 */ class ASTTypeParametersTest : ParserTestSpec({ - - parserTest("Test simple parameters", javaVersions = J1_8..Latest) { - + parserTestContainer("Test simple parameters", javaVersions = J1_8..Latest) { inContext(TypeParametersParsingCtx) { - "" should parseAs { typeParamList { typeParam("T") } } - "" should parseAs { typeParamList { typeParam("T") @@ -42,7 +38,6 @@ class ASTTypeParametersTest : ParserTestSpec({ } } - "<@F T extends @N Runnable>" should parseAs { typeParamList { typeParam("T") { @@ -56,5 +51,4 @@ class ASTTypeParametersTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt index 71092f20cf..6b7196eea5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTTypeTest.kt @@ -11,12 +11,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe * @since 7.0.0 */ class ASTTypeTest : ParserTestSpec({ - - parserTest("Test ambiguous qualified names") { - + parserTestContainer("Test ambiguous qualified names") { inContext(TypeParsingCtx) { - - "java.util.List" should parseAs { classType("List") { @@ -53,8 +49,7 @@ class ASTTypeTest : ParserTestSpec({ } } - parserTest("Test non-ambiguous segments") { - + parserTestContainer("Test non-ambiguous segments") { // Perhaps surprisingly a type annotation binds to the closest segment // So @B binds to "java" // If the annotation is not applicable to TYPE_USE then it doesn't compile @@ -64,10 +59,7 @@ class ASTTypeTest : ParserTestSpec({ // TYPE_USE annotations are prohibited e.g. before a declaration inContext(TypeParsingCtx) { - - "@B @H java.util.@C @K Map" should parseAs { - classType("Map") { it::getQualifier shouldBe classType("util") { it::getQualifier shouldBe classType("java") { @@ -81,7 +73,6 @@ class ASTTypeTest : ParserTestSpec({ } } - "java.util.Map.@Foo Entry" should parseAs { classType("Entry") { it::getQualifier shouldBe null @@ -109,7 +100,6 @@ class ASTTypeTest : ParserTestSpec({ "Foo.@A Bar.Brew" should parseAs { classType("Brew") { - it::getQualifier shouldBe classType("Bar") { it::getTypeArguments shouldBe null diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt index d13cb2483c..b55937768f 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTUnaryExpressionTest.kt @@ -14,9 +14,7 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.BOOL import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ASTUnaryExpressionTest : ParserTestSpec({ - - parserTest("Simple unary expressions") { - + parserTestContainer("Simple unary expressions") { inContext(ExpressionParsingCtx) { "-2" should parseAs { unaryExpr(UNARY_MINUS) { @@ -26,8 +24,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({ } } - parserTest("Unary expression precedence") { - + parserTestContainer("Unary expression precedence") { inContext(ExpressionParsingCtx) { "2 + -2" should parseAs { infixExpr(ADD) { @@ -66,6 +63,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({ } } } + "+-(int)a" should parseAs { unaryExpr(UNARY_PLUS) { unaryExpr(UNARY_MINUS) { @@ -82,8 +80,7 @@ class ASTUnaryExpressionTest : ParserTestSpec({ } } - parserTest("Unary expression ambiguity corner cases") { - + parserTestContainer("Unary expression ambiguity corner cases") { // the following cases test ambiguity between cast of unary, and e.g. parenthesized additive expr // see https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-UnaryExpressionNotPlusMinus @@ -99,7 +96,6 @@ class ASTUnaryExpressionTest : ParserTestSpec({ } } - "(p)~q" should parseAs { castExpr { classType("p") @@ -151,7 +147,6 @@ class ASTUnaryExpressionTest : ParserTestSpec({ // "++i++" parses, but doesn't compile, so don't test it // same for eg "p+++++q" (which doesn't parse) - (JPrimitiveType.PrimitiveTypeKind.values().toList() - BOOLEAN) .forEach { type -> @@ -201,11 +196,8 @@ class ASTUnaryExpressionTest : ParserTestSpec({ } } - - parserTest("Unary expression is right-associative") { - + parserTestContainer("Unary expression is right-associative") { inContext(ExpressionParsingCtx) { - "!!true" should parseAs { unaryExpr(NEGATION) { unaryExpr(NEGATION) { diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt index 2178115173..fc936cf1f5 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTWildcardTypeTest.kt @@ -14,12 +14,9 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J1_8 * @since 7.0.0 */ class ASTWildcardTypeTest : ParserTestSpec({ - - parserTest("Test simple names", javaVersions = J1_5..Latest) { - + parserTestContainer("Test simple names", javaVersions = J1_5..Latest) { inContext(TypeParsingCtx) { "List" should parseAs { - classType("List") { typeArgList { child { @@ -33,7 +30,6 @@ class ASTWildcardTypeTest : ParserTestSpec({ } "List" should parseAs { - classType("List") { typeArgList { child { @@ -47,7 +43,6 @@ class ASTWildcardTypeTest : ParserTestSpec({ } "List" should parseAs { - classType("List") { typeArgList { child { @@ -64,8 +59,7 @@ class ASTWildcardTypeTest : ParserTestSpec({ } } - parserTest("Annotation placement", javaVersions = J1_8..Latest) { - + parserTestContainer("Annotation placement", javaVersions = J1_8..Latest) { inContext(TypeParsingCtx) { "List<@A @B ? extends @C B>" should parseAs { @@ -88,6 +82,4 @@ class ASTWildcardTypeTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt index f55ba94940..9fd274d4b4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt @@ -13,27 +13,25 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType * */ class ConstValuesKotlinTest : ProcessorTestSpec({ - - parserTest("Test reference cycle doesn't crash resolution") { - doTest { - val acu = parser.parse(""" - class Foo { - static final int I1 = I2; - static final int I2 = I1; - static final int I3 = 0; - } - """.trimIndent()) - - val (i1, i2, i3) = acu.descendants(ASTVariableId::class.java).toList() - - i1.initializer!!.constValue shouldBe null - i2.initializer!!.constValue shouldBe null - i3.initializer!!.constValue shouldBe 0 - - i3.symbol.shouldBeA { - it.constValue shouldBe 0 + val acu = parser.parse( + """ + class Foo { + static final int I1 = I2; + static final int I2 = I1; + static final int I3 = 0; } + """.trimIndent() + ) + + val (i1, i2, i3) = acu.descendants(ASTVariableId::class.java).toList() + + i1.initializer!!.constValue shouldBe null + i2.initializer!!.constValue shouldBe null + i3.initializer!!.constValue shouldBe 0 + + i3.symbol.shouldBeA { + it.constValue shouldBe 0 } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt index 9d621fadfc..baba8487ca 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java11Test.kt @@ -9,84 +9,76 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.Companion.Latest import net.sourceforge.pmd.lang.test.ast.shouldBe class Java11Test : ParserTestSpec({ - - parserTestGroup("Test lambda parameter with var keyword") { - + parserTestContainer("Test lambda parameter with var keyword (pre-java 11)", javaVersions = J1_8..J10) { // var keyword should be a normal type pre-java 11 - onVersions(J1_8..J10) { - - inContext(ExpressionParsingCtx) { - - "(var x) -> String.valueOf(x)" should parseAs { - exprLambda { - it::getParameters shouldBe lambdaFormals { - lambdaParam { - modifiers { } - classType("var") - variableId("x") - } + inContext(ExpressionParsingCtx) { + "(var x) -> String.valueOf(x)" should parseAs { + exprLambda { + it::getParameters shouldBe lambdaFormals { + lambdaParam { + modifiers { } + classType("var") + variableId("x") } - - methodCall("valueOf") } - } - "(var x, var y) -> x + y" should parseAs { - exprLambda { - it::getParameters shouldBe lambdaFormals { - lambdaParam { - modifiers { } - classType("var") - variableId("x") - } - - lambdaParam { - modifiers { } - classType("var") - variableId("y") - } - } - - infixExpr(BinaryOp.ADD) - } - } - - "(@Nonnull var x) -> String.valueOf(x)" should parseAs { - exprLambda { - it::getParameters shouldBe lambdaFormals { - lambdaParam { - modifiers { - annotation("Nonnull") - } - classType("var") - variableId("x") - } - } - methodCall("valueOf") - } + methodCall("valueOf") } } - } - // var keyword should generate no type after java 11 - onVersions(J11..Latest) { - - inContext(ExpressionParsingCtx) { - "(var x) -> String.valueOf(x)" should parseAs { - exprLambda { - it::getParameters shouldBe lambdaFormals { - lambdaParam { - modifiers { } - it::isTypeInferred shouldBe true - variableId("x") - } + "(var x, var y) -> x + y" should parseAs { + exprLambda { + it::getParameters shouldBe lambdaFormals { + lambdaParam { + modifiers { } + classType("var") + variableId("x") } - methodCall("valueOf") + lambdaParam { + modifiers { } + classType("var") + variableId("y") + } } + + infixExpr(BinaryOp.ADD) + } + } + + "(@Nonnull var x) -> String.valueOf(x)" should parseAs { + exprLambda { + it::getParameters shouldBe lambdaFormals { + lambdaParam { + modifiers { + annotation("Nonnull") + } + classType("var") + variableId("x") + } + } + methodCall("valueOf") } } } } + parserTestContainer("Test lambda parameter with var keyword (java 11+)", javaVersions = J11..Latest) { + // var keyword should generate no type after java 11 + inContext(ExpressionParsingCtx) { + "(var x) -> String.valueOf(x)" should parseAs { + exprLambda { + it::getParameters shouldBe lambdaFormals { + lambdaParam { + modifiers { } + it::isTypeInferred shouldBe true + variableId("x") + } + } + + methodCall("valueOf") + } + } + } + } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt index 03e2b01cf8..1850333a14 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/Java15KotlinTest.kt @@ -8,10 +8,8 @@ import io.kotest.matchers.shouldBe import net.sourceforge.pmd.lang.test.ast.shouldBe class Java15KotlinTest : ParserTestSpec({ - // Note: More tests are in ASTLiteralTest. - parserTest("textBlocks", javaVersions = JavaVersion.J15..JavaVersion.Latest) { - + parserTestContainer("textBlocks", javaVersions = JavaVersion.J15..JavaVersion.Latest) { val tblock = "\"\"\"\n" + // 4 spaces of insignificant indentation " \n" + @@ -35,5 +33,4 @@ class Java15KotlinTest : ParserTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt index 7609f2a3cc..594a063545 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/JavaTextAccessTest.kt @@ -14,15 +14,10 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.* private val TextAvailableNode.textStr: String get() = text.toString() class JavaTextAccessTest : ParserTestSpec({ - - - parserTest("Test parens") { - + parserTestContainer("Test parens") { inContext(StatementParsingCtx) { - "int a = ((3));" should parseAs { localVarDecl { - it.textStr shouldBe "int a = ((3));" modifiers { @@ -44,7 +39,6 @@ class JavaTextAccessTest : ParserTestSpec({ "int a = ((a)).f;" should parseAs { localVarDecl { - it.textStr shouldBe "int a = ((a)).f;" modifiers { @@ -71,7 +65,6 @@ class JavaTextAccessTest : ParserTestSpec({ // the left parens shouldn't be flattened by AbstractLrBinaryExpr "int a = ((1 + 2) + f);" should parseAs { localVarDecl { - it.textStr shouldBe "int a = ((1 + 2) + f);" modifiers { 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 c1c97245a6..82576e1eaf 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 @@ -8,6 +8,7 @@ import com.github.oowekyala.treeutils.matchers.baseShouldMatchSubtree import com.github.oowekyala.treeutils.printers.KotlintestBeanTreePrinter import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.scopes.AbstractContainerScope +import io.kotest.core.test.NestedTest import io.kotest.core.test.TestScope import io.kotest.matchers.Matcher import io.kotest.matchers.MatcherResult @@ -183,7 +184,8 @@ open class ParserTestCtx(testScope: TestScope, val importedTypes: MutableList> = mutableListOf(), val otherImports: MutableList = mutableListOf(), var packageName: String = "", - var genClassHeader: String = "class Foo"): AbstractContainerScope(testScope) { + var genClassHeader: String = "class Foo", + private var registeredTestCases: Int = 0): AbstractContainerScope(testScope) { var parser: JavaParsingHelper = javaVersion.parser.withProcessing(false) private set @@ -272,8 +274,13 @@ open class ParserTestCtx(testScope: TestScope, "Expected '$value' not to parse in ${nodeParsingCtx.toString().addArticle()}" } ) - } } + override suspend fun registerTestCase(nested: NestedTest) { + registeredTestCases++ + super.registerTestCase(nested) + } + + fun hasMoreThanOneChild() : Boolean = registeredTestCases > 1 } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/LanguageLevelCheckTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/LanguageLevelCheckTests.kt index 0133d94880..f37a81e538 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/LanguageLevelCheckTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/LanguageLevelCheckTests.kt @@ -14,64 +14,55 @@ import net.sourceforge.pmd.lang.java.ast.JavaVersion.J9 * @author Clรฉment Fournier */ class LanguageLevelCheckTests : ParserTestSpec({ - - parserTestGroup("Reserved 'var' identifier") { - - onVersions(J10..Latest) { - - inContext(TopLevelTypeDeclarationParsingCtx) { - "/*Top*/ class var { }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - } - - inContext(TypeBodyParsingCtx) { - - "public enum var { A }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - - "public class var { }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - - "public interface var { }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - - "public @interface var { }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - - "public void var() { return; }" should parse() - } - - inContext(StatementParsingCtx) { - "/*Local*/ class var { }" should throwParseException { ex -> - ex.message.shouldContain("'var' is reserved and cannot be used as a type name") - } - - "int var = 0;" should parse() // only fail on type decls - "var var = 0;" should parse() - } - - inContext(ExpressionParsingCtx) { - "(var) -> {}" should parse() // only fail on type decls + parserTestContainer("Reserved 'var' identifier (java 10+)", javaVersions = J10..Latest) { + inContext(TopLevelTypeDeclarationParsingCtx) { + "/*Top*/ class var { }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") } } - onVersions(Earliest..J9) { - - inContext(TopLevelTypeDeclarationParsingCtx) { - "/*Top*/ class var { }" should parse() + inContext(TypeBodyParsingCtx) { + "public enum var { A }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") } - inContext(StatementParsingCtx) { - "/*Local*/ class var { }" should parse() - "int var = 0;" should parse() + "public class var { }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") } + + "public interface var { }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") + } + + "public @interface var { }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") + } + + "public void var() { return; }" should parse() + } + + inContext(StatementParsingCtx) { + "/*Local*/ class var { }" should throwParseException { ex -> + ex.message.shouldContain("'var' is reserved and cannot be used as a type name") + } + + "int var = 0;" should parse() // only fail on type decls + "var var = 0;" should parse() + } + + inContext(ExpressionParsingCtx) { + "(var) -> {}" should parse() // only fail on type decls } } + parserTestContainer("Reserved 'var' identifier (pre java-10)", javaVersions = Earliest..J9) { + inContext(TopLevelTypeDeclarationParsingCtx) { + "/*Top*/ class var { }" should parse() + } + inContext(StatementParsingCtx) { + "/*Local*/ class var { }" should parse() + "int var = 0;" should parse() + } + } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt index 3b38656fa6..688aebc4f2 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ModifiersTest.kt @@ -10,18 +10,14 @@ import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility.* import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT class ModifiersTest : ParserTestSpec({ - - parserTest("Local classes") { - + parserTestContainer("Local classes") { inContext(StatementParsingCtx) { - """ @F class Local { private int i; } """ should parseAs { localClassDecl(simpleName = "Local") { - it::getVisibility shouldBe V_LOCAL it::getEffectiveVisibility shouldBe V_LOCAL @@ -51,10 +47,8 @@ class ModifiersTest : ParserTestSpec({ } } - parserTest("Anon classes") { - + parserTestContainer("Anon classes") { inContext(StatementParsingCtx) { - """ new Runnable() { private int i; @@ -88,6 +82,4 @@ class ModifiersTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt index 66b8bddc4f..ffa7023cae 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/OverrideResolutionTest.kt @@ -6,10 +6,8 @@ package net.sourceforge.pmd.lang.java.ast import io.kotest.matchers.shouldBe class OverrideResolutionTest : ProcessorTestSpec({ - parserTest("Test override resolution prefers superclass method") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ interface Foo { default void foo() {} } interface Bar { default void foo() {} } @@ -21,18 +19,16 @@ class OverrideResolutionTest : ProcessorTestSpec({ } } """ - ) - val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - subFoo.overriddenMethod shouldBe supFoo.genericSignature - barFoo.overriddenMethod shouldBe null - fooFoo.overriddenMethod shouldBe null - supFoo.overriddenMethod shouldBe null - } + ) + val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + subFoo.overriddenMethod shouldBe supFoo.genericSignature + barFoo.overriddenMethod shouldBe null + fooFoo.overriddenMethod shouldBe null + supFoo.overriddenMethod shouldBe null } parserTest("Test override resolution without superclass") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ interface Foo { default void foo() {} } interface Bar { default void foo() {} } @@ -44,18 +40,16 @@ class OverrideResolutionTest : ProcessorTestSpec({ } } """ - ) - val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - supFoo.overriddenMethod shouldBe barFoo.genericSignature - subFoo.overriddenMethod shouldBe fooFoo.genericSignature - barFoo.overriddenMethod shouldBe null - fooFoo.overriddenMethod shouldBe null - } + ) + val (fooFoo, barFoo, supFoo, subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + supFoo.overriddenMethod shouldBe barFoo.genericSignature + subFoo.overriddenMethod shouldBe fooFoo.genericSignature + barFoo.overriddenMethod shouldBe null + fooFoo.overriddenMethod shouldBe null } parserTest("Test override resolution unresolved") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ public class Sub implements Unresolved { @Override @@ -63,10 +57,8 @@ class OverrideResolutionTest : ProcessorTestSpec({ } } """ - ) - val (subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - subFoo.overriddenMethod shouldBe subFoo.typeSystem.UNRESOLVED_METHOD - } + ) + val (subFoo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + subFoo.overriddenMethod shouldBe subFoo.typeSystem.UNRESOLVED_METHOD } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt index 8ada650628..0115146a43 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParenthesesTest.kt @@ -13,12 +13,8 @@ import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind.INT * @since 7.0.0 */ class ParenthesesTest : ParserTestSpec({ - - - parserTest("Test parens") { - + parserTestContainer("Test parens") { inContext(StatementParsingCtx) { - "int a = 3;" should parseAs { localVarDecl { localVarModifiers { } @@ -161,15 +157,12 @@ class ParenthesesTest : ParserTestSpec({ } } - - parserTest("Test expressions with complicated LHS") { - + parserTestContainer("Test expressions with complicated LHS") { // the qualifier here is not an ASTPrimaryExpression, // since parentheses are flattened. // The API should reflect that inContext(ExpressionParsingCtx) { - "((String) obj).length()" should parseAs { methodCall("length") { @@ -204,7 +197,6 @@ class ParenthesesTest : ParserTestSpec({ "(switch (obj) { case a -> 1; default -> 2; }).length()" should parseAs { methodCall("length") { - it::getQualifier shouldBe parenthesized { switchExpr() } @@ -214,6 +206,4 @@ class ParenthesesTest : ParserTestSpec({ } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt index f3994d2d7b..5910d76116 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ParserTestSpec.kt @@ -31,7 +31,41 @@ import io.kotest.matchers.should as kotlintestShould * Base class for grammar tests that use the DSL. Tests are layered into * containers that make it easier to browse in the IDE. Layout is group name, * then java version, then test case. Test cases are "should" assertions matching - * a string against a matcher defined in [ParserTestCtx]. + * a string against a matcher defined in [ParserTestCtx] or explicitly defined + * test cases with "doTest". + * + *

If only one explicit test is written, then use "parserTest" as the grouping + * and just put in assertions. A single test case will be defined implicitly then. + * + *

{@code
+ * class MyTest : ParserTestSpec({
+ *     parserTestContainer("Simple additive expression should be flat") {
+ *         inContext(ExpressionParsingCtx) {
+ *             "1 + 2 + 3" should parseAs {
+ *                 infixExpr(ADD) {
+ *                     infixExpr(ADD) {
+ *                         int(1)
+ *                         int(2)
+ *                     }
+ *                     int(3)
+ *                 }
+ *             }
+ *         }
+ *         doTest("another test case") {
+ *           //...
+ *         }
+ *     }
+ *
+ *    parserTest("Test annotations on module", javaVersions = since(J9)) {
+ *         val root: ASTCompilationUnit = parser.withProcessing(true).parse("@A @a.B module foo { } ")
+ *         root.moduleDeclaration.shouldMatchNode {
+ *             it.getAnnotation("A") shouldBe annotation("A")
+ *             it.getAnnotation("a.B") shouldBe annotation("B")
+ *             modName("foo")
+ *         }
+ *     }
+ * }
+ * }
* * @author Clรฉment Fournier */ @@ -50,7 +84,6 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() test = test ) - /** * Defines a group of tests that should be named similarly, * with separate tests for separate versions. @@ -67,7 +100,7 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() * new parser test. * */ - fun parserTestGroup(name: String, + private fun parserTestGroup(name: String, disabled: Boolean = false, spec: suspend GroupTestCtx.() -> Unit) = addContainer( @@ -77,32 +110,47 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() config = null ) - /** - * Defines a group of tests that should be named similarly. - * Calls to "should" in the block are intercepted to create - * a new test, with the given [name] as a common prefix. - * - * This is useful to make a batch of grammar specs for grammar - * regression tests without bothering to find a name. - * - * @param name Name of the container test - * @param javaVersion Language versions to use when parsing - * @param spec Assertions. Each call to [io.kotest.matchers.should] on a string - * receiver is replaced by a [GroupTestCtx.should], which creates a - * new parser test. - * - */ fun parserTest(name: String, javaVersion: JavaVersion = JavaVersion.Latest, spec: suspend GroupTestCtx.VersionedTestCtx.() -> Unit) = - parserTest(name, listOf(javaVersion), spec) + parserTest(name, listOf(javaVersion), spec) + + /** + * Defines a single test case, that is executed on several java versions + * and grouped by the given [name]. + * + * @param name Name of the container test + * @param javaVersions Language versions fo which to generate tests + * @param spec Assertions. + */ + fun parserTest(name: String, + javaVersions: List, + spec: suspend GroupTestCtx.VersionedTestCtx.() -> Unit) = + parserTestGroup(name) { + onVersions(javaVersions) { + doTest(name) { + spec() + + if (this@onVersions.hasMoreThanOneChild()) { + throw IllegalStateException("Expected no child test cases, but parserTest '$name' has children. Use 'parserTestContainer' instead.") + } + } + } + } + + fun parserTestContainer(name: String, + javaVersion: JavaVersion = JavaVersion.Latest, + spec: suspend GroupTestCtx.VersionedTestCtx.() -> Unit) = + parserTestContainer(name, listOf(javaVersion), spec) /** * Defines a group of tests that should be named similarly, - * executed on several java versions. Calls to "should" in - * the block are intercepted to create a new test, with the - * given [name] as a common prefix. Alternatively you can use - * "doTest" to define a new test case. + * executed on several java versions. + * Calls to "should" in the block are intercepted to create a + * new test, with the given [name] as a common prefix. + * + * Alternatively you can use "doTest" to define a new test case + * explicitly. * * This is useful to make a batch of grammar specs for grammar * regression tests without bothering to find a name. @@ -112,9 +160,9 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() * @param spec Assertions. Each call to [io.kotest.matchers.should] on a string * receiver is replaced by a [GroupTestCtx.VersionedTestCtx.should], which creates a * new parser test case. Alternatively use [GroupTestCtx.VersionedTestCtx.doTest] to create - * a new parser test case. + * a new parser test case explicitly. */ - fun parserTest(name: String, + fun parserTestContainer(name: String, javaVersions: List, spec: suspend GroupTestCtx.VersionedTestCtx.() -> Unit) = parserTestGroup(name) { @@ -122,7 +170,7 @@ abstract class ParserTestSpec(body: ParserTestSpec.() -> Unit) : DslDrivenSpec() spec() if (!this@onVersions.hasChildren()) { - throw IllegalStateException("versioned parser test '$name' without a test case. Use 'should' or 'doTest'.") + throw IllegalStateException("Expected at least one child test case, but parserTestContainer '$name' has no children. Use 'parserTest' instead or use 'should'/'doTest'.") } } } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt index 1f4e24fe27..5d279aa6a3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/TypeDisambiguationTest.kt @@ -17,39 +17,35 @@ import kotlin.test.assertEquals import kotlin.test.assertNull class TypeDisambiguationTest : ParserTestSpec({ - - parserTest("Inner class names") { - doTest { - enableProcessing() + enableProcessing() - val acu = parser.parse( + val acu = parser.parse( """ class Foo { Foo.Inner f1; class Inner { } } """ - ) + ) - val (foo, inner) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.symbol } - val (f1) = acu.descendants(ASTFieldDeclaration::class.java).toList() + val (foo, inner) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.symbol } + val (f1) = acu.descendants(ASTFieldDeclaration::class.java).toList() - f1.typeNode.shouldMatchNode { + f1.typeNode.shouldMatchNode { + it::isFullyQualified shouldBe false + it::getSimpleName shouldBe "Inner" + it::getReferencedSym shouldBe inner + it::getAmbiguousLhs shouldBe null + it::getQualifier shouldBe classType("Foo") { it::isFullyQualified shouldBe false - it::getSimpleName shouldBe "Inner" - it::getReferencedSym shouldBe inner - it::getAmbiguousLhs shouldBe null - it::getQualifier shouldBe classType("Foo") { - it::isFullyQualified shouldBe false - it::getReferencedSym shouldBe foo - } + it::getReferencedSym shouldBe foo } } } - parserTest("Fully qualified names") { + parserTestContainer("Fully qualified names") { enableProcessing(true) inContext(TypeParsingCtx) { @@ -75,8 +71,7 @@ class TypeDisambiguationTest : ParserTestSpec({ } } - parserTest("Package names in module") { - + parserTestContainer("Package names in module") { val code = """ module java.base { opens java.util; @@ -100,7 +95,7 @@ class TypeDisambiguationTest : ParserTestSpec({ } - parserTest("Failures") { + parserTestContainer("Failures") { val logger = enableProcessing() val acu = parser.parse(""" @@ -137,7 +132,7 @@ class TypeDisambiguationTest : ParserTestSpec({ } } - parserTest("Ambiguity errors") { + parserTestContainer("Ambiguity errors") { val logger = enableProcessing() val acu = parser.parse(""" @@ -176,10 +171,9 @@ class TypeDisambiguationTest : ParserTestSpec({ } parserTest("Malformed types") { - doTest { - val logger = enableProcessing() + val logger = enableProcessing() - val acu = parser.parse( + val acu = parser.parse( """ package p; class Scratch { @@ -206,41 +200,39 @@ class TypeDisambiguationTest : ParserTestSpec({ // Scratch.Inner m; // ok, raw type } """ - ) + ) - val (m0, m1, m2, m3, m4, m5, s0, s1, s2) = - acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() + val (m0, m1, m2, m3, m4, m5, s0, s1, s2) = + acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() - fun assertErrored(t: ASTClassType, expected: Int, actual: Int) { - val errs = logger.warnings[MALFORMED_GENERIC_TYPE]?.filter { it.first == t } - ?: emptyList() - assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") - errs.single().second.toList() shouldBe listOf(expected, actual) - } - - fun assertNoError(t: ASTClassType) { - val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } - assertNull(err, "`${t.text}` should not have produced an error") - } - - assertNoError(m0) - assertErrored(m1, expected = 0, actual = 1) - assertNoError(m2) - assertErrored(m3, expected = 2, actual = 1) - assertErrored(m4, expected = 2, actual = 3) - assertNoError(m5) - - assertNoError(s0) - assertErrored(s1, expected = 1, actual = 2) - assertNoError(s2) + fun assertErrored(t: ASTClassType, expected: Int, actual: Int) { + val errs = logger.warnings[MALFORMED_GENERIC_TYPE]?.filter { it.first == t } + ?: emptyList() + assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") + errs.single().second.toList() shouldBe listOf(expected, actual) } + + fun assertNoError(t: ASTClassType) { + val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } + assertNull(err, "`${t.text}` should not have produced an error") + } + + assertNoError(m0) + assertErrored(m1, expected = 0, actual = 1) + assertNoError(m2) + assertErrored(m3, expected = 2, actual = 1) + assertErrored(m4, expected = 2, actual = 3) + assertNoError(m5) + + assertNoError(s0) + assertErrored(s1, expected = 1, actual = 2) + assertNoError(s2) } parserTest("Unresolved inner types") { - doTest { - enableProcessing() + enableProcessing() - val acu = parser.parse( + val acu = parser.parse( """ package p; @@ -250,44 +242,41 @@ class TypeDisambiguationTest : ParserTestSpec({ OuterUnresolved.InnerUnresolved m0; } """ - ) + ) - val (m0) = - acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() + val (m0) = + acu.descendants(ASTFieldDeclaration::class.java).map { it.typeNode as ASTClassType }.toList() - val outerUnresolved = m0.qualifier!! - val outerT = outerUnresolved.typeMirror.shouldBeA { - it.symbol.shouldBeA { classSymbol -> - classSymbol::isUnresolved shouldBe true - classSymbol::getSimpleName shouldBe "OuterUnresolved" - } + val outerUnresolved = m0.qualifier!! + val outerT = outerUnresolved.typeMirror.shouldBeA { + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "OuterUnresolved" } - - val innerT = m0.typeMirror.shouldBeA { - it::getEnclosingType shouldBe outerT - it.symbol.shouldBeA { classSymbol -> - classSymbol::isUnresolved shouldBe true - classSymbol::getSimpleName shouldBe "InnerUnresolved" - classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) - } - } - - outerT.symbol.getDeclaredClass("InnerUnresolved").shouldBeSameInstanceAs(innerT.symbol) } + + val innerT = m0.typeMirror.shouldBeA { + it::getEnclosingType shouldBe outerT + it.symbol.shouldBeA { classSymbol -> + classSymbol::isUnresolved shouldBe true + classSymbol::getSimpleName shouldBe "InnerUnresolved" + classSymbol.enclosingClass.shouldBeSameInstanceAs(outerT.symbol) + } + } + + outerT.symbol.getDeclaredClass("InnerUnresolved").shouldBeSameInstanceAs(innerT.symbol) } parserTest("Invalid annotations") { - doTest { - val logger = enableProcessing() + val logger = enableProcessing() - val acu = parser.parse( + val acu = parser.parse( """ package p; class C { @interface A { } interface I { } - @T @C @I @@ -296,30 +285,29 @@ class TypeDisambiguationTest : ParserTestSpec({ int field; } """ - ) + ) - val (aT, aC, aI, aUnresolved, aOk) = - acu.descendants(ASTAnnotation::class.java).map { it.typeNode }.toList() + val (aT, aC, aI, aUnresolved, aOk) = + acu.descendants(ASTAnnotation::class.java).map { it.typeNode }.toList() - fun assertErrored(t: ASTClassType) { - val errs = logger.warnings[EXPECTED_ANNOTATION_TYPE]?.filter { it.first == t } - ?: emptyList() - assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") - errs.single().second.toList() shouldBe emptyList() - } - - fun assertNoError(t: ASTClassType) { - val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } - assertNull(err, "`${t.text}` should not have produced an error") - } - - assertNoError(aUnresolved) - assertNoError(aOk) - - assertErrored(aT) - assertErrored(aC) - assertErrored(aI) + fun assertErrored(t: ASTClassType) { + val errs = logger.warnings[EXPECTED_ANNOTATION_TYPE]?.filter { it.first == t } + ?: emptyList() + assertEquals(errs.size, 1, "`${t.text}` should have produced a single error") + errs.single().second.toList() shouldBe emptyList() } + + fun assertNoError(t: ASTClassType) { + val err = logger.warnings[MALFORMED_GENERIC_TYPE]?.firstOrNull { it.first == t } + assertNull(err, "`${t.text}` should not have produced an error") + } + + assertNoError(aUnresolved) + assertNoError(aOk) + + assertErrored(aT) + assertErrored(aC) + assertErrored(aI) } parserTest("!TODO Import on demand of class defined in same compilation unit that has an extends clause") { @@ -343,6 +331,5 @@ class Assert2 extends Assert { class Foo2 extends Foo { } """) - } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt index bee62d6479..d63547f212 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/UsageResolutionTest.kt @@ -15,10 +15,8 @@ import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol import net.sourceforge.pmd.lang.java.symbols.JFormalParamSymbol class UsageResolutionTest : ProcessorTestSpec({ - parserTest("Test usage resolution") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ class Bar { int f1; @@ -41,21 +39,19 @@ class UsageResolutionTest : ProcessorTestSpec({ } } """ - ) - val (barF1, fooF1, fooF2, localF2, localF22) = acu.descendants(ASTVariableId::class.java).toList() - barF1.localUsages.map { it.text.toString() }.shouldContainExactly("this.f1", "super.f1") - fooF1.localUsages.map { it.text.toString() }.shouldContainExactly("f1", "this.f1") - fooF2.localUsages.map { it.text.toString() }.shouldContainExactly("this.f2") - localF2.localUsages.shouldBeEmpty() - localF22.localUsages.shouldBeSingleton { - it.accessType shouldBe WRITE - } + ) + val (barF1, fooF1, fooF2, localF2, localF22) = acu.descendants(ASTVariableId::class.java).toList() + barF1.localUsages.map { it.text.toString() }.shouldContainExactly("this.f1", "super.f1") + fooF1.localUsages.map { it.text.toString() }.shouldContainExactly("f1", "this.f1") + fooF2.localUsages.map { it.text.toString() }.shouldContainExactly("this.f2") + localF2.localUsages.shouldBeEmpty() + localF22.localUsages.shouldBeSingleton { + it.accessType shouldBe WRITE } } parserTest("Test record components") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ record Foo(int p) { Foo { @@ -65,23 +61,21 @@ class UsageResolutionTest : ProcessorTestSpec({ void pPlus1() { return p + 1; } } """ - ) + ) - val (p) = acu.descendants(ASTVariableId::class.java).toList() + val (p) = acu.descendants(ASTVariableId::class.java).toList() - p::isRecordComponent shouldBe true - p.localUsages.shouldHaveSize(2) - p.localUsages[0].shouldBeA { - it.referencedSym!!.shouldBeA { symbol -> - symbol.tryGetNode() shouldBe p - } + p::isRecordComponent shouldBe true + p.localUsages.shouldHaveSize(2) + p.localUsages[0].shouldBeA { + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } - p.localUsages[1].shouldBeA { - it.referencedSym!!.shouldBeA { symbol -> - symbol.tryGetNode() shouldBe p - } + } + p.localUsages[1].shouldBeA { + it.referencedSym!!.shouldBeA { symbol -> + symbol.tryGetNode() shouldBe p } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt index 56fd0976fd..ae0d635610 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/VarDisambiguationTest.kt @@ -14,9 +14,7 @@ import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol import net.sourceforge.pmd.lang.java.symbols.table.internal.JavaSemanticErrors.* class VarDisambiguationTest : ParserTestSpec({ - - - parserTest("AmbiguousName reclassification") { + parserTestContainer("AmbiguousName reclassification") { val code = (""" package com.foo.bar; class Foo { @@ -85,7 +83,7 @@ class VarDisambiguationTest : ParserTestSpec({ } } - parserTest("Disambiguation bug") { + parserTestContainer("Disambiguation bug") { val code = (""" class Foo { protected void setBandIndexes() { @@ -112,7 +110,7 @@ class VarDisambiguationTest : ParserTestSpec({ } } - parserTest("Failure cases") { + parserTestContainer("Failure cases") { val code = (""" package com.foo.bar; class Foo { @@ -152,7 +150,6 @@ class Foo { parser.parse(code) doTest("Unresolved field") { - logger.getWarning(CANNOT_RESOLVE_MEMBER, 0) { node, args -> args shouldBe listOf("noField", "com.foo.bar.Foo.Inner", "a field access") @@ -169,7 +166,6 @@ class Foo { } doTest("Unresolved field chain") { - logger.getWarning(CANNOT_RESOLVE_MEMBER, 1) { node, args -> args shouldBe listOf("noField", "com.foo.bar.Foo.Inner", "a field access") @@ -188,7 +184,6 @@ class Foo { } doTest("Unresolved type var member") { - logger.getWarning(CANNOT_RESOLVE_MEMBER, 2) { node, args -> args shouldBe listOf("fofo", "type variable T", "a field access") @@ -205,7 +200,6 @@ class Foo { } doTest("Unresolved type var member (in type ctx)") { - logger.getWarning(CANNOT_RESOLVE_MEMBER, 3) { node, args -> args shouldBe listOf("Fofo", "type variable T", "an unresolved type") diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt index 650033a3f4..9befdfd5f4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolResolverTest.kt @@ -15,9 +15,7 @@ import net.sourceforge.pmd.lang.java.symbols.JClassSymbol * @author Clรฉment Fournier */ class AstSymbolResolverTest : ProcessorTestSpec({ - - parserTest("Simple test") { - + parserTestContainer("Simple test") { val resolver = parser.parse(""" package com.foo.bar; @@ -30,8 +28,6 @@ class AstSymbolResolverTest : ProcessorTestSpec({ InternalApiBridge.getProcessor(it).symResolver } - - doTest("Test outer class") { resolver.resolveClassFromBinaryName("com.foo.bar") shouldBe null resolver.resolveClassFromBinaryName("com.foo.bar.Foo").shouldBeA { } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt index e6a19c4981..4dbe34608a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/internal/AstSymbolTests.kt @@ -21,11 +21,8 @@ import java.lang.reflect.Modifier * @since 7.0.0 */ class AstSymbolTests : ParserTestSpec({ - - parserTest("Parsed class symbols") { - + parserTestContainer("Parsed class symbols") { val acu = parser.withProcessing().parse(""" - package com.foo; import java.util.ArrayList; @@ -146,9 +143,7 @@ class AstSymbolTests : ParserTestSpec({ } } - - parserTest("Default/implicit constructors") { - + parserTestContainer("Default/implicit constructors") { val acu = parser.withProcessing().parse(""" package com.foo; @@ -195,7 +190,6 @@ class AstSymbolTests : ParserTestSpec({ } doTest("Classes should have no default constructor if there are explicit ones") { - bClass.constructors[0].shouldBeA { it.formalParameters.shouldBeEmpty() it.modifiers shouldBe Modifier.PROTECTED @@ -223,8 +217,7 @@ class AstSymbolTests : ParserTestSpec({ } } - parserTest("Enum details") { - + parserTestContainer("Enum details") { val acu = parser.withProcessing().parse(""" enum EE { A, B } enum E2 { A { } /* anon */ } @@ -262,11 +255,8 @@ class AstSymbolTests : ParserTestSpec({ } } - - parserTest("Local class symbols") { - + parserTestContainer("Local class symbols") { val acu = parser.withProcessing().parse(""" - package com.foo; public final class Foo { // fooClass @@ -307,7 +297,6 @@ class AstSymbolTests : ParserTestSpec({ val (ctor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } val (barM, ohioM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - locals shouldBe listOf(ctorLoc, barLoc, ohioLoc, anonLoc, initLoc, staticInitLoc) doTest("should reflect their modifiers") { @@ -351,13 +340,9 @@ class AstSymbolTests : ParserTestSpec({ initLoc::getEnclosingMethod shouldBe null staticInitLoc::getEnclosingMethod shouldBe null } - } - - - parserTest("Record symbols") { - + parserTestContainer("Record symbols") { // TODO explicit declaration of canonical ctor (need type res) val acu = parser.withProcessing().parse(""" @@ -447,7 +432,6 @@ class AstSymbolTests : ParserTestSpec({ } } - doTest("should declare field accessors") { pointRecord.declaredMethods should haveSize(2) pointRecord.getDeclaredMethods("x") shouldBe listOf(xAccessor) @@ -460,12 +444,8 @@ class AstSymbolTests : ParserTestSpec({ } } - - - parserTest("Anonymous class symbols") { - + parserTestContainer("Anonymous class symbols") { val acu = parser.withProcessing().parse(""" - package com.foo; public class Foo { // fooClass diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt index 02b84165d4..bcb5981fb3 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/HeaderScopesTest.kt @@ -67,212 +67,176 @@ class HeaderScopesTest : ProcessorTestSpec({ } parserTest("Test same-package scope") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) + val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) - acu.symbolTable.types().shouldResolveToClass("SomeClassA", "javasymbols.testdata.SomeClassA") - } + acu.symbolTable.types().shouldResolveToClass("SomeClassA", "javasymbols.testdata.SomeClassA") } - parserTest("$javalangTypes should be shadowed by $typesInTheSamePackage") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) + val acu = parser.parseClass(javasymbols.testdata.TestCase1::class.java) - - acu.symbolTable.types().typeShadowSequence("Thread") shouldBe - // from same package - listOf( - SAME_PACKAGE to "javasymbols.testdata.Thread", - JAVA_LANG to "java.lang.Thread" - ) - } + acu.symbolTable.types().typeShadowSequence("Thread") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.Thread", + JAVA_LANG to "java.lang.Thread" + ) } - - parserTest("$typesInTheSamePackage should be shadowed by $singleTypeImports") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) + val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe - // from same package - listOf( - SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", - SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA" - ) - } + acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe + // from same package + listOf( + SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", + SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA" + ) } parserTest("$javalangTypes should be shadowed by $singleTypeImports") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) + val acu = parser.parseClass(javasymbols.testdata.deep.SomewhereElse::class.java) - acu.symbolTable.types().typeShadowSequence("Thread") shouldBe - listOf( - SINGLE_IMPORT to "javasymbols.testdata.Thread", - JAVA_LANG to "java.lang.Thread" - ) - } + acu.symbolTable.types().typeShadowSequence("Thread") shouldBe + listOf( + SINGLE_IMPORT to "javasymbols.testdata.Thread", + JAVA_LANG to "java.lang.Thread" + ) } - parserTest("$onDemandTypeImports should be shadowed by everything") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.TypeImportsOnDemand::class.java) - // import javasymbols.testdata.*; + val acu = parser.parseClass(javasymbols.testdata.deep.TypeImportsOnDemand::class.java) + // import javasymbols.testdata.*; - val group = acu.symbolTable.types() + val group = acu.symbolTable.types() - group.typeShadowSequence("Thread") shouldBe - // from java.lang - listOf( - JAVA_LANG to "java.lang.Thread", - IMPORT_ON_DEMAND to "javasymbols.testdata.Thread" - ) + group.typeShadowSequence("Thread") shouldBe + // from java.lang + listOf( + JAVA_LANG to "java.lang.Thread", + IMPORT_ON_DEMAND to "javasymbols.testdata.Thread" + ) - group.typeShadowSequence("SomeClassA") shouldBe - // from same package - listOf( - SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", - IMPORT_ON_DEMAND to "javasymbols.testdata.SomeClassA" - ) + group.typeShadowSequence("SomeClassA") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", + IMPORT_ON_DEMAND to "javasymbols.testdata.SomeClassA" + ) - group.typeShadowSequence("Statics") shouldBe - // from the import-on-demand - listOf(IMPORT_ON_DEMAND to "javasymbols.testdata.Statics") + group.typeShadowSequence("Statics") shouldBe + // from the import-on-demand + listOf(IMPORT_ON_DEMAND to "javasymbols.testdata.Statics") - group.typeShadowSequence("TestCase1") shouldBe - // from the single type import - listOf( - SINGLE_IMPORT to "javasymbols.testdata.TestCase1", - IMPORT_ON_DEMAND to "javasymbols.testdata.TestCase1" - ) - } + group.typeShadowSequence("TestCase1") shouldBe + // from the single type import + listOf( + SINGLE_IMPORT to "javasymbols.testdata.TestCase1", + IMPORT_ON_DEMAND to "javasymbols.testdata.TestCase1" + ) } - - parserTest("$onDemandStaticImports should import only accessible members") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; + acu.symbolTable.let { + it.variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null + it.variables().resolveFirst("PACKAGE_FIELD") shouldBe null + it.variables().resolveFirst("PRIVATE_FIELD") shouldBe null + it.variables().resolveFirst("PROTECTED_FIELD") shouldBe null - acu.symbolTable.let { + it.resolveMethods("packageMethod").shouldHaveSize(0) + it.resolveMethods("privateMethod").shouldHaveSize(0) + it.resolveMethods("protectedMethod").shouldHaveSize(0) + it.resolveMethods("publicMethod").shouldHaveSize(2) + it.resolveMethods("publicMethod2").shouldHaveSize(1) - it.variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null - it.variables().resolveFirst("PACKAGE_FIELD") shouldBe null - it.variables().resolveFirst("PRIVATE_FIELD") shouldBe null - it.variables().resolveFirst("PROTECTED_FIELD") shouldBe null - - it.resolveMethods("packageMethod").shouldHaveSize(0) - it.resolveMethods("privateMethod").shouldHaveSize(0) - it.resolveMethods("protectedMethod").shouldHaveSize(0) - it.resolveMethods("publicMethod").shouldHaveSize(2) - it.resolveMethods("publicMethod2").shouldHaveSize(1) - - it.types().resolveFirst("PublicStatic") shouldNotBe null - it.types().resolveFirst("PackageStatic") shouldBe null - it.types().resolveFirst("ProtectedStatic") shouldBe null - it.types().resolveFirst("PrivateStatic") shouldBe null - - } + it.types().resolveFirst("PublicStatic") shouldNotBe null + it.types().resolveFirst("PackageStatic") shouldBe null + it.types().resolveFirst("ProtectedStatic") shouldBe null + it.types().resolveFirst("PrivateStatic") shouldBe null } } parserTest("$onDemandStaticImports should import only static members") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.apply { + acu.symbolTable.apply { + variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null + variables().resolveFirst("publicField") shouldBe null - variables().resolveFirst("PUBLIC_FIELD") shouldNotBe null - variables().resolveFirst("publicField") shouldBe null + resolveMethods("publicMethod").shouldHaveSize(2) + resolveMethods("publicInstanceMethod").shouldHaveSize(0) - resolveMethods("publicMethod").shouldHaveSize(2) - resolveMethods("publicInstanceMethod").shouldHaveSize(0) - - types().resolveFirst("PublicStatic") shouldNotBe null - types().resolveFirst("PublicInner") shouldBe null - } + types().resolveFirst("PublicStatic") shouldNotBe null + types().resolveFirst("PublicInner") shouldBe null } } parserTest("Types imported through $onDemandStaticImports should be shadowed by $typesInTheSamePackage") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticImportOnDemand::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.types().typeShadowSequence("PublicShadowed") shouldBe - // from same package - listOf( - SAME_PACKAGE to "javasymbols.testdata.deep.PublicShadowed", - IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$PublicShadowed" - ) - } + acu.symbolTable.types().typeShadowSequence("PublicShadowed") shouldBe + // from same package + listOf( + SAME_PACKAGE to "javasymbols.testdata.deep.PublicShadowed", + IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$PublicShadowed" + ) } parserTest("Types imported through $onDemandStaticImports should be shadowed by $singleTypeImports") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticIOD2::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticIOD2::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe - listOf( - SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", - SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", - IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$SomeClassA" - ) - } + acu.symbolTable.types().typeShadowSequence("SomeClassA") shouldBe + listOf( + SINGLE_IMPORT to "javasymbols.testdata.SomeClassA", + SAME_PACKAGE to "javasymbols.testdata.deep.SomeClassA", + IMPORT_ON_DEMAND to "javasymbols.testdata.Statics\$SomeClassA" + ) } parserTest("$staticSingleMemberImports should import types, fields and methods with the same name") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.let { - it.resolveField("Ola") shouldBe classSym(StaticNameCollision::class.java)!!.getDeclaredField("Ola")!! - it.resolveMethods("Ola").shouldContainExactly( - classSym(StaticNameCollision::class.java)!!.getDeclaredMethods("Ola").toList() - ) - it.types().shouldResolveToClass("Ola", "javasymbols.testdata.StaticNameCollision\$Ola") - } + acu.symbolTable.let { + it.resolveField("Ola") shouldBe classSym(StaticNameCollision::class.java)!!.getDeclaredField("Ola")!! + it.resolveMethods("Ola").shouldContainExactly( + classSym(StaticNameCollision::class.java)!!.getDeclaredMethods("Ola").toList() + ) + it.types().shouldResolveToClass("Ola", "javasymbols.testdata.StaticNameCollision\$Ola") } } parserTest("$staticSingleMemberImports should import inherited members") { - doTest { - val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) - // import javasymbols.testdata.Statics.*; + val acu = parser.parseClass(javasymbols.testdata.deep.StaticCollisionImport::class.java) + // import javasymbols.testdata.Statics.*; - acu.symbolTable.let { - it.resolveField("oha") shouldBe classSym(StaticsSuper::class.java)!!.getDeclaredField("oha")!! - it.resolveMethods("oha") - .shouldContainExactly(classSym(StaticsSuper::class.java)!!.getDeclaredMethods("oha").toList()) - it.types().shouldResolveToClass("oha", "javasymbols.testdata.StaticsSuper\$oha") - } + acu.symbolTable.let { + it.resolveField("oha") shouldBe classSym(StaticsSuper::class.java)!!.getDeclaredField("oha")!! + it.resolveMethods("oha") + .shouldContainExactly(classSym(StaticsSuper::class.java)!!.getDeclaredMethods("oha").toList()) + it.types().shouldResolveToClass("oha", "javasymbols.testdata.StaticsSuper\$oha") } } - parserTest("Method imported through $onDemandStaticImports should be shadowed by $staticSingleMemberImports") { - + parserTestContainer("Method imported through $onDemandStaticImports should be shadowed by $staticSingleMemberImports") { val acu = parser.parse( """ - import static javasymbols.testdata.StaticNameCollision.publicMethod; import static javasymbols.testdata.Statics.*; class Foo {} - """ ) - doTest("The static import should shadow methods with the same name") { + doTest("The static import should shadow methods with the same name") { acu.symbolTable.methods().iterateResults("publicMethod").let { it.next() it.apply { @@ -293,8 +257,8 @@ class HeaderScopesTest : ProcessorTestSpec({ } } } - doTest("Other names are not shadowed but treated separately") { + doTest("Other names are not shadowed but treated separately") { acu.symbolTable.methods().iterateResults("publicMethod2").let { // other names are still imported by the import on demand @@ -310,12 +274,10 @@ class HeaderScopesTest : ProcessorTestSpec({ } } - parserTest("#3768 static imported type shadows java.lang") { - doTest { - assertNoSemanticErrorsOrWarnings() + assertNoSemanticErrorsOrWarnings() - val acu = parser.parse( + val acu = parser.parse( """ import static javasymbols.testdata.deep.StaticContainer.Exception; @@ -325,16 +287,14 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) + ) - acu.symbolTable.types() - .shouldResolveToClass("Exception", "javasymbols.testdata.deep.StaticContainer\$Exception") - } + acu.symbolTable.types() + .shouldResolveToClass("Exception", "javasymbols.testdata.deep.StaticContainer\$Exception") } parserTest("#3768 static imported type does not shadow non-static imported type") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ import static javasymbols.testdata.deep.StaticContainer.Exception; import java.lang.Exception; @@ -345,24 +305,21 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) + ) - acu.symbolTable.types().resolve("Exception") - .map { (it.symbol as JClassSymbol).binaryName } - .shouldContainExactlyInAnyOrder( - "javasymbols.testdata.deep.StaticContainer\$Exception", - "java.lang.Exception" - ) - } + acu.symbolTable.types().resolve("Exception") + .map { (it.symbol as JClassSymbol).binaryName } + .shouldContainExactlyInAnyOrder( + "javasymbols.testdata.deep.StaticContainer\$Exception", + "java.lang.Exception" + ) } parserTest("Import of an unconventional name with dollar") { - doTest { - assertNoSemanticErrorsOrWarnings() + assertNoSemanticErrorsOrWarnings() - val acu = parser.parse( + val acu = parser.parse( """ - import javasymbols.testdata.deep.ClassWithDollar${'$'}; public class Foo { @@ -371,22 +328,21 @@ class HeaderScopesTest : ProcessorTestSpec({ } } """ - ) + ) - val moduleAccess = acu.descendants(ASTFieldAccess::class.java).first().shouldNotBeNull() - with(acu.typeDsl) { - moduleAccess shouldHaveType ts.OBJECT - moduleAccess.qualifier.shouldBeA { - it shouldHaveType ts.rawType(ts.getClassSymbol("javasymbols.testdata.deep.ClassWithDollar\$")) - } + val moduleAccess = acu.descendants(ASTFieldAccess::class.java).first().shouldNotBeNull() + with(acu.typeDsl) { + moduleAccess shouldHaveType ts.OBJECT + moduleAccess.qualifier.shouldBeA { + it shouldHaveType ts.rawType(ts.getClassSymbol("javasymbols.testdata.deep.ClassWithDollar\$")) } } } - parserTest("Import static on demand with inner (non-static) class") { - doTest { - assertNoSemanticErrorsOrWarnings() - val acu = parser.parse( + parserTest("Import static on demand with inner (non-static) class") { + assertNoSemanticErrorsOrWarnings() + + val acu = parser.parse( """ package ${OuterWithoutDollar::class.java.`package`.name}; import static ${OuterWithoutDollar::class.java.name}.*; @@ -394,14 +350,9 @@ class HeaderScopesTest : ProcessorTestSpec({ static {} } """ - ) + ) - val block = acu.descendants(ASTBlock::class.java).firstOrThrow() - block.symbolTable.types().resolve("Inner").shouldBeEmpty() - } + val block = acu.descendants(ASTBlock::class.java).firstOrThrow() + block.symbolTable.types().resolve("Inner").shouldBeEmpty() } }) - - - - diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt index 76bb0a6939..cd723cebc8 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/LocalTypeScopesTest.kt @@ -12,12 +12,8 @@ import net.sourceforge.pmd.lang.java.types.shouldHaveType import net.sourceforge.pmd.lang.java.types.typeDsl class LocalTypeScopesTest : ParserTestSpec({ - - - parserTest("Scoping of types in a compilation unit") { - + parserTestContainer("Scoping of types in a compilation unit") { val acu = parser.withProcessing().parse(""" - package myTest; import java.util.List; @@ -42,27 +38,19 @@ class LocalTypeScopesTest : ParserTestSpec({ acu.descendants(ASTFieldDeclaration::class.java).crossFindBoundaries().toList() doTest("Inside a type: other toplevel types and inner classes are in scope") { - insideFoo.symbolTable.shouldResolveTypeTo("Foo", foo) insideFoo.symbolTable.shouldResolveTypeTo("Inner", inner) insideFoo.symbolTable.shouldResolveTypeTo("Other", other) - } doTest("Inside a sibling: inner classes are not in scope") { - insideOther.symbolTable.shouldResolveTypeTo("Foo", foo) - insideOther.symbolTable.types().resolveFirst("Inner") shouldBe null - insideOther.symbolTable.shouldResolveTypeTo("Other", other) - } - } - parserTest("Scoping of local classes") { - + parserTestContainer("Scoping of local classes") { val acu = parser.withProcessing().parse(""" package myTest; @@ -82,7 +70,6 @@ class LocalTypeScopesTest : ParserTestSpec({ acu.descendants(ASTStatement::class.java).toList() doTest("Before the local type declaration, only the nested class is in scope") { - iVar.symbolTable.shouldResolveTypeTo("Inner", inner) listOf(i2Var, localClass).forEach { @@ -91,10 +78,8 @@ class LocalTypeScopesTest : ParserTestSpec({ } } - parserTest("Scoping of types w.r.t. imports") { - + parserTestContainer("Scoping of types w.r.t. imports") { val acu = parser.withProcessing().parse(""" - package myTest; import somewhere.Inner; @@ -119,7 +104,6 @@ class LocalTypeScopesTest : ParserTestSpec({ acu.descendants(ASTFieldDeclaration::class.java).crossFindBoundaries().toList() doTest("Inside Foo/Inner: Inner is the inner class") { - insideFoo.symbolTable.shouldResolveTypeTo("Inner", inner.typeMirror) insideInner.symbolTable.shouldResolveTypeTo("Inner").let { @@ -128,14 +112,12 @@ class LocalTypeScopesTest : ParserTestSpec({ } doTest("Inside extends clause: Inner is the import") { - foo.superClassTypeNode.symbolTable.shouldResolveTypeTo("Inner").let { it.symbol::getCanonicalName shouldBe "somewhere.Inner" } } doTest("Inside Other: Inner is imported") { - insideOther.symbolTable.shouldResolveTypeTo("Inner").let { it.symbol::getCanonicalName shouldBe "somewhere.Inner" it.symbol::isUnresolved shouldBe true @@ -145,8 +127,7 @@ class LocalTypeScopesTest : ParserTestSpec({ parserTest("Inner class creation expressions should have inner classes in scope") { - doTest { - val acu = parser.withProcessing().parse( + val acu = parser.withProcessing().parse( """ package scratch; @@ -173,23 +154,20 @@ class LocalTypeScopesTest : ParserTestSpec({ static class I4 {} } """ - ) + ) + val (n2, mapEntry, kkEntry, n2i2, i4) = + acu.descendants(ASTClassType::class.java).toList() - val (n2, mapEntry, kkEntry, n2i2, i4) = - acu.descendants(ASTClassType::class.java).toList() + val (_, cKK, cKkEntry, cN2, cN2i2) = + acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (_, cKK, cKkEntry, cN2, cN2i2) = - acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - // setup - n2.typeMirror.symbol shouldBe cN2.symbol - mapEntry shouldHaveType with(acu.typeDsl) { java.util.Map.Entry::class.raw } - kkEntry shouldHaveType cKkEntry - (kkEntry.typeMirror as JClassType).enclosingType shouldBe cKK // not cN2! this calls getAsSuper - n2i2 shouldHaveType cN2i2 - i4.typeMirror.symbol?.isUnresolved shouldBe true - } + // setup + n2.typeMirror.symbol shouldBe cN2.symbol + mapEntry shouldHaveType with(acu.typeDsl) { java.util.Map.Entry::class.raw } + kkEntry shouldHaveType cKkEntry + (kkEntry.typeMirror as JClassType).enclosingType shouldBe cKK // not cN2! this calls getAsSuper + n2i2 shouldHaveType cN2i2 + i4.typeMirror.symbol?.isUnresolved shouldBe true } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt index c6338baede..468d17748a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/MemberInheritanceTest.kt @@ -19,12 +19,9 @@ import net.sourceforge.pmd.lang.java.types.* @Suppress("UNUSED_VARIABLE") class MemberInheritanceTest : ParserTestSpec({ - parserTest("Test problem with values scope in enum") { - doTest { - inContext(ExpressionParsingCtx) { - - val acu = parser.withProcessing().parse( + inContext(ExpressionParsingCtx) { + val acu = parser.withProcessing().parse( """ package coco; @@ -44,31 +41,26 @@ class MemberInheritanceTest : ParserTestSpec({ public enum Set { STANDARD, PICOJAVA } } + """.trimIndent() + ) - """.trimIndent() - ) + val (outer, inner) = acu.descendants(ASTEnumDeclaration::class.java).toList { it.symbol } - val (outer, inner) = acu.descendants(ASTEnumDeclaration::class.java).toList { it.symbol } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - call.shouldMatchN { - methodCall("values") { - - it.symbolTable.methods().resolve("values").shouldBeSingleton { - it.symbol.enclosingClass shouldBe outer - } - - argList(0) {} + call.shouldMatchN { + methodCall("values") { + it.symbolTable.methods().resolve("values").shouldBeSingleton { + it.symbol.enclosingClass shouldBe outer } + + argList(0) {} } } } } - - parserTest("Comb rule: methods of an inner type shadow methods of the enclosing ones") { - + parserTestContainer("Comb rule: methods of an inner type shadow methods of the enclosing ones") { val acu = parser.withProcessing().parse(""" package test; @@ -109,7 +101,6 @@ class MemberInheritanceTest : ParserTestSpec({ acu.descendants(ASTTypeDeclaration::class.java).toList { it.body!! } doTest("Inside Sup: Sup#f(int) is in scope") { - sup.symbolTable.methods().resolve("f").let { it.shouldHaveSize(1) it[0] shouldBe supF @@ -145,8 +136,7 @@ class MemberInheritanceTest : ParserTestSpec({ } } - parserTest("Non-static methods in static inner class") { - + parserTestContainer("Non-static methods in static inner class") { val acu = parser.withProcessing().parse(""" package test; @@ -182,8 +172,7 @@ class MemberInheritanceTest : ParserTestSpec({ } - parserTest("Non-static methods in inner class") { - + parserTestContainer("Non-static methods in inner class") { val acu = parser.withProcessing().parse(""" package test; @@ -215,14 +204,10 @@ class MemberInheritanceTest : ParserTestSpec({ doTest("Inside Inner: all methods are in scope") { inner.symbolTable.methods().resolve("f").shouldContainExactly(innerF, outerF, staticOuter) } - } - - parserTest("Methods of Object are in scope in interfaces") { - doTest { - val acu = parser.withProcessing().parse( + val acu = parser.withProcessing().parse( """ interface Foo { default Class foo() { @@ -230,27 +215,23 @@ class MemberInheritanceTest : ParserTestSpec({ } } """ - ) + ) - val (insideFoo) = - acu.descendants(ASTMethodCall::class.java).toList() + val (insideFoo) = + acu.descendants(ASTMethodCall::class.java).toList() - insideFoo.symbolTable.methods().resolve("getClass").also { - it.shouldHaveSize(1) - it[0].apply { - formalParameters shouldBe emptyList() - declaringType shouldBe acu.typeSystem.OBJECT - } + insideFoo.symbolTable.methods().resolve("getClass").also { + it.shouldHaveSize(1) + it[0].apply { + formalParameters shouldBe emptyList() + declaringType shouldBe acu.typeSystem.OBJECT } } } - parserTest("Inner types may be inherited") { - doTest { - val acu = parser.withProcessing().parse( + val acu = parser.withProcessing().parse( """ - class Scratch { class Inner {} } @@ -265,37 +246,33 @@ class MemberInheritanceTest : ParserTestSpec({ } """ - ) + ) - val (typeScratch, typeInner) = - acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (typeScratch, typeInner) = + acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val insideFoo = - acu.descendants(ASTClassBody::class.java) - .crossFindBoundaries().get(2)!! + val insideFoo = + acu.descendants(ASTClassBody::class.java) + .crossFindBoundaries().get(2)!! - val `typeScratch{String}Inner` = with(acu.typeDsl) { - typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) - } + val `typeScratch{String}Inner` = with(acu.typeDsl) { + typeScratch[gen.t_String].selectInner(typeInner.symbol, emptyList()) + } - insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { - it.shouldBe(`typeScratch{String}Inner`) - } + insideFoo.symbolTable.types().resolve("Inner").shouldBeSingleton { + it.shouldBe(`typeScratch{String}Inner`) + } - val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! + val typeNode = acu.descendants(ASTClassType::class.java).first { it.simpleName == "Inner" }!! - typeNode.shouldMatchN { - classType("Inner") { - it shouldHaveType `typeScratch{String}Inner` - } + typeNode.shouldMatchN { + classType("Inner") { + it shouldHaveType `typeScratch{String}Inner` } } } - - - parserTest("Shadowing of inherited types") { - + parserTestContainer("Shadowing of inherited types") { doTest("Inaccessible member types of supertypes hide types inherited from further supertypes") { val acu = parser.withProcessing().parse(""" @@ -368,11 +345,9 @@ class MemberInheritanceTest : ParserTestSpec({ fun ShadowChain.resolveSyms(name: String) = resolve(name).map { it.symbol } - parserTest("Ambiguity handling when inheriting members from several unrelated interfaces") { - + parserTestContainer("Ambiguity handling when inheriting members from several unrelated interfaces") { // only happens for types & fields, for methods this is handled through override/overload resolution - doTest("Case 1: two unrelated interfaces") { val acu = parser.withProcessing().parse(""" @@ -394,19 +369,14 @@ class Impl implements I1, I2 { val (i1, i1c, i2, i2c) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() - - withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i1c, i2c) // ambiguous - } - withClue("For fields") { + withClue("For fields") { implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i1a.symbol, i2a.symbol) // ambiguous - } } @@ -431,20 +401,14 @@ class Impl implements I1, I2 { val (i1, i1c, i2, i2c) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() - - withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i1c, i2c) // ambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i1a.symbol, i2a.symbol) // ambiguous - } } @@ -469,20 +433,14 @@ class Impl implements I2 { // <- difference here val (i1, i1c, i2, i2c) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() - - withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i2c) // unambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i2a.symbol) // unambiguous - } } @@ -510,17 +468,13 @@ class Impl extends I2 implements I1 { // <- still implements I1 val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i2c, i1c) // ambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i2a.symbol, i1a.symbol) // ambiguous - } } @@ -548,17 +502,13 @@ class Impl extends I2 implements I1 { // <- still implements I1 val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i2c, i1c) // ambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i2a.symbol, i1a.symbol) // unambiguous - } } @@ -586,17 +536,13 @@ class Impl extends I2 implements I1 { // <- still implements I1 val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i1c) // unambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i1a.symbol) // unambiguous - } } @@ -625,17 +571,13 @@ class Impl extends I2 { // <- difference here, doesn't implement I1 val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i2c) // unambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i2a.symbol) // unambiguous - } } @@ -669,23 +611,18 @@ class Impl extends Sup { val (i1a, i2a, supA, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(supC) // ambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(supA.symbol) // unambiguous - } } doTest("Case 7: ambiguity in n+1 supertypes may be transferred to subclass") { - val acu = parser.withProcessing().parse(""" @@ -714,17 +651,13 @@ class Impl extends Sup { val (i1a, i2a, implA) = acu.descendants(ASTVariableId::class.java).toList() withClue("For types") { - implA.symbolTable.types().resolve("C") shouldBe listOf(i1c, i2c) // ambiguous - } withClue("For fields") { - implA.symbolTable.variables().resolveSyms("A") shouldBe listOf(i1a.symbol, i2a.symbol) // unambiguous - } } @@ -732,8 +665,7 @@ class Impl extends Sup { parserTest("Import of member defined in the file should not fail") { - doTest { - val acu = parser.withProcessing().parse( + val acu = parser.withProcessing().parse( """ package p; @@ -756,29 +688,26 @@ class Top { } } """ - ) + ) - val importedFieldAccess = acu.descendants(ASTVariableAccess::class.java).firstOrThrow() - val importedFieldSym = acu.descendants(ASTVariableId::class.java) - .crossFindBoundaries().firstOrThrow().symbol + val importedFieldAccess = acu.descendants(ASTVariableAccess::class.java).firstOrThrow() + val importedFieldSym = acu.descendants(ASTVariableId::class.java) + .crossFindBoundaries().firstOrThrow().symbol - val importedMethodCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val importedMethodSym = acu.descendants(ASTMethodDeclaration::class.java) - .crossFindBoundaries().firstOrThrow().symbol + val importedMethodCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val importedMethodSym = acu.descendants(ASTMethodDeclaration::class.java) + .crossFindBoundaries().firstOrThrow().symbol - importedFieldAccess.referencedSym shouldBe importedFieldSym - importedMethodCall.methodType.symbol shouldBe importedMethodSym - } + importedFieldAccess.referencedSym shouldBe importedFieldSym + importedMethodCall.methodType.symbol shouldBe importedMethodSym } - parserTest("Static methods of interfaces are not in scope in subclasses") { - doTest { - // This is what allows the import below to not be shadowed by the inherited declaration - // This was tested with javac. The intellij compiler doesn't understand this code. + // This is what allows the import below to not be shadowed by the inherited declaration + // This was tested with javac. The intellij compiler doesn't understand this code. - val acu = parser.withProcessing().parse( - """ + val acu = parser.withProcessing().parse( + """ package p; import static p.Top2.foo; @@ -805,21 +734,19 @@ interface Top2 { static void foo() {} } """ - ) + ) - val (fooInTop1, _, fooInTop2) = acu.methodDeclarations().toList() - val (call1, call2, callInBar) = acu.methodCalls().crossFindBoundaries().toList() + val (fooInTop1, _, fooInTop2) = acu.methodDeclarations().toList() + val (call1, call2, callInBar) = acu.methodCalls().crossFindBoundaries().toList() - withClue(call1) { - call1.methodType.symbol shouldBe fooInTop2.symbol - } - withClue(call2) { - call2.methodType.symbol shouldBe fooInTop2.symbol - } - withClue(callInBar) { - callInBar.methodType.symbol shouldBe fooInTop1.symbol - } + withClue(call1) { + call1.methodType.symbol shouldBe fooInTop2.symbol + } + withClue(call2) { + call2.methodType.symbol shouldBe fooInTop2.symbol + } + withClue(callInBar) { + callInBar.methodType.symbol shouldBe fooInTop1.symbol } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt index e99c36ad39..341aa08587 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/PatternVarScopingTests.kt @@ -13,8 +13,6 @@ import net.sourceforge.pmd.lang.java.ast.* * */ class PatternVarScopingTests : ProcessorTestSpec({ - - fun ParserTestCtx.checkVars(firstIsPattern: Boolean, secondIsPattern: Boolean, code: () -> String) { val exprCode = code().trimIndent() val sourceCode = """ @@ -40,10 +38,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } - parserTest("Bindings with if/else", javaVersion = JavaVersion.J17) { - + parserTestContainer("Bindings with if/else", javaVersion = JavaVersion.J17) { doTest("If with then that falls through") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> { @@ -57,7 +53,6 @@ class PatternVarScopingTests : ProcessorTestSpec({ } doTest("If with then that falls through, negated condition") { - checkVars(firstIsPattern = false, secondIsPattern = false) { """ a -> { @@ -71,7 +66,6 @@ class PatternVarScopingTests : ProcessorTestSpec({ } doTest("If with else and negated condition") { - checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -85,7 +79,6 @@ class PatternVarScopingTests : ProcessorTestSpec({ } doTest("If with then that completes abruptly") { - checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -98,8 +91,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Test while(true) is handled correctly") { + doTest("Test while(true) is handled correctly") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ args -> { @@ -114,11 +107,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } - parserTest("Bindings within condition", javaVersion = JavaVersion.J17) { - - + parserTestContainer("Bindings within condition", javaVersion = JavaVersion.J17) { doTest("Condition with and") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> { @@ -131,7 +121,6 @@ class PatternVarScopingTests : ProcessorTestSpec({ } doTest("Condition with or (negated)") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> { @@ -142,8 +131,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Condition with or") { + doTest("Condition with or") { checkVars(firstIsPattern = false, secondIsPattern = false) { """ a -> { @@ -156,12 +145,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } - - parserTest("Bindings within ternary", javaVersion = JavaVersion.J17) { - - + parserTestContainer("Bindings within ternary", javaVersion = JavaVersion.J17) { doTest("Positive cond") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> a instanceof String var ? var.isEmpty() // the binding @@ -169,8 +154,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negative cond") { + doTest("Negative cond") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> !(a instanceof String var) ? var.isEmpty() // the field @@ -178,53 +163,43 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - } - - parserTest("Bindings within labeled stmt", javaVersion = JavaVersion.J17) { - doTest { - checkVars(firstIsPattern = false, secondIsPattern = true) { - """ - a -> { - label: - if (!(a instanceof String var)) { - var.toString(); // the field - return; - } - var.toString(); // the binding - } - """ + checkVars(firstIsPattern = false, secondIsPattern = true) { + """ + a -> { + label: + if (!(a instanceof String var)) { + var.toString(); // the field + return; + } + var.toString(); // the binding } + """ } } parserTest("Bindings within switch expr with yield", javaVersion = JavaVersion.J17) { - doTest { - checkVars(firstIsPattern = false, secondIsPattern = true) { - """ - a -> switch (1) { - case 1 -> { - if (!(a instanceof String var)) { - var.toString(); // the field - yield 12; - } - var.toString(); // the binding - yield 2; - } - } - """ + checkVars(firstIsPattern = false, secondIsPattern = true) { + """ + a -> switch (1) { + case 1 -> { + if (!(a instanceof String var)) { + var.toString(); // the field + yield 12; + } + var.toString(); // the binding + yield 2; + } } + """ } } - parserTest("Bindings within for loop", javaVersion = JavaVersion.J17) { - - + parserTestContainer("Bindings within for loop", javaVersion = JavaVersion.J17) { doTest("Positive cond") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> { @@ -236,8 +211,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond, body does nothing") { + doTest("Negated cond, body does nothing") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -249,8 +224,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond, body doesn't break") { + doTest("Negated cond, body doesn't break") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -264,8 +239,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond, body does break") { + doTest("Negated cond, body does break") { checkVars(firstIsPattern = false, secondIsPattern = false) { """ a -> { @@ -277,6 +252,7 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } + doTest("Both bindings and init vars are in scope") { inContext(StatementParsingCtx) { val loop = doParse( @@ -295,11 +271,9 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } } - parserTest("Bindings within while loop", javaVersion = JavaVersion.J17) { - + parserTestContainer("Bindings within while loop", javaVersion = JavaVersion.J17) { doTest("Positive cond") { - checkVars(firstIsPattern = true, secondIsPattern = false) { """ a -> { @@ -311,8 +285,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond") { + doTest("Negated cond") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -324,8 +298,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond, body doesn't break") { + doTest("Negated cond, body doesn't break") { checkVars(firstIsPattern = false, secondIsPattern = true) { """ a -> { @@ -340,8 +314,8 @@ class PatternVarScopingTests : ProcessorTestSpec({ """ } } - doTest("Negated cond, body does break") { + doTest("Negated cond, body does break") { checkVars(firstIsPattern = false, secondIsPattern = false) { """ a -> { @@ -355,5 +329,4 @@ class PatternVarScopingTests : ProcessorTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/SuperTypesEnumeratorTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/SuperTypesEnumeratorTest.kt index f5d6ef8072..851dcb74a7 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/SuperTypesEnumeratorTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/SuperTypesEnumeratorTest.kt @@ -11,12 +11,9 @@ import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.typeDsl class SuperTypesEnumeratorTest : ParserTestSpec({ - - fun SuperTypesEnumerator.list(t: JClassType) = iterable(t).toList() - parserTest("All supertypes test") { - + parserTestContainer("All supertypes test") { val acu = parser.withProcessing().parse(""" package test; @@ -73,7 +70,5 @@ class SuperTypesEnumeratorTest : ParserTestSpec({ SUPERCLASSES_AND_SELF.list(sup) should containExactly(sup, sup.typeSystem.OBJECT) SUPERCLASSES_AND_SELF.list(sub) should containExactly(sub, sup, sup.typeSystem.OBJECT) } - } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt index 0546cc0878..77810c2ec6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/TypeParamScopingTest.kt @@ -13,11 +13,8 @@ import net.sourceforge.pmd.lang.java.types.JClassType import net.sourceforge.pmd.lang.java.types.JTypeVar class TypeParamScopingTest : ParserTestSpec({ - - parserTest("Scoping of type parameters") { - + parserTestContainer("Scoping of type parameters") { val acu = parser.withProcessing().parse(""" - package myTest; import somewhere.T; @@ -49,36 +46,28 @@ class TypeParamScopingTest : ParserTestSpec({ .crossFindBoundaries().toList() doTest("Inside Foo: T is Foo#T") { - insideFoo.symbolTable.shouldResolveTypeTo("T", fooT.typeMirror) } doTest("Inside Inner: T is Foo#T") { - insideInner.symbolTable.shouldResolveTypeTo("T", fooT.typeMirror) } doTest("Inside Inner2: T is Inner2#T, shadowed") { - insideInner2.symbolTable.shouldResolveTypeTo("T", inner2T.typeMirror) } doTest("Inside Other: T is imported, type params are not in scope") { - insideOther.symbolTable.shouldResolveTypeTo("T").let { it.symbol::getCanonicalName shouldBe "somewhere.T" it.symbol::isUnresolved shouldBe true } } - } - parserTest("Scoping inside a type param section") { - + parserTestContainer("Scoping inside a type param section") { doTest("Bounded by a param to the right") { - val acu = parser.withProcessing().parse(""" - package myTest; class Foo {} @@ -93,9 +82,7 @@ class TypeParamScopingTest : ParserTestSpec({ } doTest("Bounded by a param to the left") { - val acu = parser.withProcessing().parse(""" - package myTest; class Foo {} @@ -110,9 +97,7 @@ class TypeParamScopingTest : ParserTestSpec({ } doTest("Bounded by itself") { - val acu = parser.withProcessing().parse(""" - package myTest; class Foo> {} @@ -125,12 +110,9 @@ class TypeParamScopingTest : ParserTestSpec({ it.symbolTable.shouldResolveTypeTo("T", t.typeMirror) } } - - } - parserTest("Type params of methods") { - + parserTestContainer("Type params of methods") { val acu = parser.withProcessing().parse(""" package myTest; @@ -167,7 +149,6 @@ class TypeParamScopingTest : ParserTestSpec({ val (_, localX, annotY) = acu.descendants(ASTTypeDeclaration::class.java).crossFindBoundaries().toList() doTest("TParams of class are in scope inside method tparam declaration") { - t2.typeBoundNode.shouldBeA { it.symbolTable.shouldResolveTypeTo("X", x.typeMirror) } @@ -175,15 +156,12 @@ class TypeParamScopingTest : ParserTestSpec({ } doTest("TParams of method are in scope in formal parameter section") { - pt.symbolTable shouldBe px.symbolTable - pt.symbolTable.shouldResolveTypeTo("T", t2.typeMirror) px.symbolTable.shouldResolveTypeTo("X", x.typeMirror) } doTest("TParams of method are in scope in method body") { - for (node in listOf(vt, vx)) { node.symbolTable.shouldResolveTypeTo("T", t2.typeMirror) node.symbolTable.shouldResolveTypeTo("X", x.typeMirror) @@ -191,9 +169,7 @@ class TypeParamScopingTest : ParserTestSpec({ } doTest("TParams of method are *not* in scope in modifier list") { - val annot = acu.descendants(ASTAnnotation::class.java).first()!! - annot.symbolTable.shouldResolveTypeTo("Y", annotY.typeMirror) // not the Y of the method annot.typeMirror.symbol.shouldBeSameInstanceAs(annotY.symbol) } @@ -201,12 +177,10 @@ class TypeParamScopingTest : ParserTestSpec({ doTest("Local class shadows type param") { vx2.symbolTable.shouldResolveTypeTo("X", localX.typeMirror) } - } - parserTest("Type parameters shadow member types") { - + parserTestContainer("Type parameters shadow member types") { val acu = parser.withProcessing().parse(""" package myTest; @@ -236,6 +210,4 @@ class TypeParamScopingTest : ParserTestSpec({ insideT.symbolTable.shouldResolveTypeTo("T", innerTClass.typeMirror) } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt index 2925d77b91..31d4ad666c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/symbols/table/internal/VarScopingTest.kt @@ -19,9 +19,7 @@ import java.lang.reflect.Modifier @Suppress("UNUSED_VARIABLE") class VarScopingTest : ProcessorTestSpec({ - - parserTest("Shadowing of variables") { - + parserTestContainer("Shadowing of variables") { val acu = parser.parse(""" // TODO test with static import, currently there are no "unresolved field" symbols @@ -99,9 +97,7 @@ class VarScopingTest : ProcessorTestSpec({ } } - - parserTest("Try statement") { - + parserTestContainer("Try statement") { val acu = parser.withProcessing().parse(""" // TODO test with static import, currently there are no "unresolved field" symbols @@ -187,8 +183,7 @@ class VarScopingTest : ProcessorTestSpec({ } } - parserTest("Switch statement") { - + parserTestContainer("Switch statement") { val acu = parser.withProcessing().parse(""" // TODO test with static import, currently there are no "unresolved field" symbols @@ -244,8 +239,7 @@ class VarScopingTest : ProcessorTestSpec({ } } - parserTest("For init variables") { - + parserTestContainer("For init variables") { val acu = parser.withProcessing().parse(""" class Outer extends Sup { { @@ -286,8 +280,8 @@ class VarScopingTest : ProcessorTestSpec({ innerLoopAccess shouldResolveToLocal ivar } } - parserTest("If stmt without a block") { + parserTestContainer("If stmt without a block") { val acu = parser.withProcessing().parse(""" class Outer extends Sup { { @@ -310,9 +304,11 @@ class VarScopingTest : ProcessorTestSpec({ doTest("Usages") { ivar.localUsages shouldBe iUsages } + doTest("Inside init") { initAccess shouldResolveToLocal ivar } + doTest("Inside condition") { condAccess shouldResolveToLocal ivar } @@ -330,8 +326,7 @@ class VarScopingTest : ProcessorTestSpec({ } } - parserTest("Record constructors") { - + parserTestContainer("Record constructors") { val acu = parser.withProcessing().parse(""" record Cons(int x, int... rest) { @@ -377,10 +372,8 @@ class VarScopingTest : ProcessorTestSpec({ } } - parserTest("Foreach with no braces") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ import java.util.*; import java.io.*; @@ -397,23 +390,20 @@ class VarScopingTest : ProcessorTestSpec({ } } """.trimIndent() - ) + ) - val foreachVar = - acu.descendants(ASTVariableId::class.java).first { it.name == "s" }!! + val foreachVar = + acu.descendants(ASTVariableId::class.java).first { it.name == "s" }!! - val foreachBody = - acu.descendants(ASTForeachStatement::class.java).firstOrThrow().body + val foreachBody = + acu.descendants(ASTForeachStatement::class.java).firstOrThrow().body - foreachBody shouldResolveToLocal foreachVar - } + foreachBody shouldResolveToLocal foreachVar } parserTest("Switch on enum has field names in scope") { - doTest { - val acu = parser.parse( - """ - + val acu = parser.parse( + """ class Scratch { enum SomeEnum { A, B } @@ -431,51 +421,47 @@ class VarScopingTest : ProcessorTestSpec({ A.foo(); // this is an ambiguous name - } - } - - """.trimIndent() - ) - - val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - val (enumA, enumB) = - acu.descendants(ASTEnumDeclaration::class.java) - .descendants(ASTVariableId::class.java).toList() - - val (e, caseA, caseB) = - acu.descendants(ASTVariableAccess::class.java).toList() - - val (qualifiedA) = - acu.descendants(ASTFieldAccess::class.java).toList() - - val (fooCall) = - acu.descendants(ASTMethodCall::class.java).toList() - - qualifiedA.referencedSym shouldBe enumA.symbol - qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA - qualifiedA shouldHaveType typeSomeEnum - - caseA.referencedSym shouldBe enumA.symbol - caseA.referencedSym!!.tryGetNode() shouldBe enumA - caseA shouldHaveType typeSomeEnum - - caseB.referencedSym shouldBe enumB.symbol - caseB.referencedSym!!.tryGetNode() shouldBe enumB - caseB shouldHaveType typeSomeEnum - - e shouldHaveType typeSomeEnum - - // symbol tables don't carry that info, this is documented on JSymbolTable#variables() - caseB.symbolTable.variables().resolve("A").shouldBeEmpty() - caseB.symbolTable.variables().resolve("B").shouldBeEmpty() - - fooCall.qualifier!!.shouldMatchN { - ambiguousName("A") - } - } } + """.trimIndent() + ) + val (_, typeSomeEnum) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + + val (enumA, enumB) = + acu.descendants(ASTEnumDeclaration::class.java) + .descendants(ASTVariableId::class.java).toList() + + val (e, caseA, caseB) = + acu.descendants(ASTVariableAccess::class.java).toList() + + val (qualifiedA) = + acu.descendants(ASTFieldAccess::class.java).toList() + + val (fooCall) = + acu.descendants(ASTMethodCall::class.java).toList() + + qualifiedA.referencedSym shouldBe enumA.symbol + qualifiedA.referencedSym!!.tryGetNode() shouldBe enumA + qualifiedA shouldHaveType typeSomeEnum + + caseA.referencedSym shouldBe enumA.symbol + caseA.referencedSym!!.tryGetNode() shouldBe enumA + caseA shouldHaveType typeSomeEnum + + caseB.referencedSym shouldBe enumB.symbol + caseB.referencedSym!!.tryGetNode() shouldBe enumB + caseB shouldHaveType typeSomeEnum + + e shouldHaveType typeSomeEnum + + // symbol tables don't carry that info, this is documented on JSymbolTable#variables() + caseB.symbolTable.variables().resolve("A").shouldBeEmpty() + caseB.symbolTable.variables().resolve("B").shouldBeEmpty() + + fooCall.qualifier!!.shouldMatchN { + ambiguousName("A") + } + } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt index 759896b7a5..20da5d2199 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/InnerTypesTest.kt @@ -12,11 +12,7 @@ import net.sourceforge.pmd.lang.test.ast.shouldMatchN import net.sourceforge.pmd.lang.java.ast.* class InnerTypesTest : ProcessorTestSpec({ - - - parserTest("Test erased types ") { - - + parserTestContainer("Test erased types ") { val acu = parser.parse(""" class Scratch { @@ -90,10 +86,8 @@ class InnerTypesTest : ProcessorTestSpec({ } parserTest("Test erased types overload resolution") { - doTest { - - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { class Inner { } @@ -108,45 +102,40 @@ class InnerTypesTest : ProcessorTestSpec({ doStuff(raw); rawScratch.doStuff(notRaw); } - } + } + """.trimIndent() + ) - """.trimIndent() - ) + val (scratch, inner) = + acu.descendants(ASTTypeDeclaration::class.java).toList() - val (scratch, inner) = - acu.descendants(ASTTypeDeclaration::class.java).toList() + val (call, rawCall) = acu.descendants(ASTMethodCall::class.java).toList() - val (call, rawCall) = acu.descendants(ASTMethodCall::class.java).toList() + val t_Scratch = scratch.typeMirror + val t_Inner = inner.typeMirror - - val t_Scratch = scratch.typeMirror - val t_Inner = inner.typeMirror - - - - call.shouldMatchN { - methodCall("doStuff") { - it.methodType.formalParameters[0].shouldBe(t_Inner) - argList { - variableAccess("raw") { - it.typeMirror.shouldBe(t_Inner.erasure) - } + call.shouldMatchN { + methodCall("doStuff") { + it.methodType.formalParameters[0].shouldBe(t_Inner) + argList { + variableAccess("raw") { + it.typeMirror.shouldBe(t_Inner.erasure) } } } + } - rawCall.shouldMatchN { - methodCall("doStuff") { - it.methodType.formalParameters[0].shouldBe(t_Inner.erasure) + rawCall.shouldMatchN { + methodCall("doStuff") { + it.methodType.formalParameters[0].shouldBe(t_Inner.erasure) - variableAccess("rawScratch") { - it.typeMirror.shouldBe(t_Scratch.erasure) - } - argList { - variableAccess("notRaw") { - it shouldHaveType with(it.typeDsl) { - t_Scratch[ts.STRING].selectInner(inner.symbol, emptyList()) - } + variableAccess("rawScratch") { + it.typeMirror.shouldBe(t_Scratch.erasure) + } + argList { + variableAccess("notRaw") { + it shouldHaveType with(it.typeDsl) { + t_Scratch[ts.STRING].selectInner(inner.symbol, emptyList()) } } } @@ -154,8 +143,7 @@ class InnerTypesTest : ProcessorTestSpec({ } } - parserTest("Inner types can be inherited") { - + parserTestContainer("Inner types can be inherited") { val acu = parser.parse(""" class Scratch { @@ -196,44 +184,36 @@ class O { val `t_Scratch{String}Inner` = `t_Scratch{String}`.selectInner(t_Inner.symbol, emptyList()) doTest("Can call ctor on the real enclosing class") { - supCtor shouldHaveType `t_Scratch{String}` innerCtor shouldHaveType `t_Scratch{String}Inner` - } doTest("Can call ctor on some subclass") { subCtor shouldHaveType `t_Sub{String}` // sub innerCtor2 shouldHaveType `t_Scratch{String}Inner` // but scratch } - } parserTest("Capturing an inner type captures the enclosing type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + class Inner { + T getT() { return null; } + } -class Scratch { - class Inner { - T getT() { return null; } - } - - static K foo(Scratch.Inner i) { - var k = i.getT(); - } -} - """.trimIndent() - ) - - val kvar = acu.typeVar("K") - - spy.shouldBeOk { - // not - acu.varId("k") shouldHaveType kvar + static K foo(Scratch.Inner i) { + var k = i.getT(); + } } + """.trimIndent() + ) + + val kvar = acu.typeVar("K") + + spy.shouldBeOk { + // not + acu.varId("k") shouldHaveType kvar } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt index 5a3763f1e0..0f27611b31 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/JMethodSigTest.kt @@ -10,44 +10,40 @@ import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec /** */ class JMethodSigTest : ProcessorTestSpec({ - parserTest("Test erasure of generic method") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - package p; - class Foo { - - T method(A a, B b) throws E {} - }""" - ) + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + package p; + class Foo { + + T method(A a, B b) throws E {} + } + """ + ) - val (a, b, t, e) = acu.typeVariables() - spy.shouldBeOk { - val m = acu.declaredMethodSignatures()[0].also { - it.formalParameters shouldBe listOf(a, b) - it.returnType shouldBe t - it.typeParameters shouldBe listOf(t, e) - it.thrownExceptions shouldBe listOf(e) + val (a, b, t, e) = acu.typeVariables() + spy.shouldBeOk { + val m = acu.declaredMethodSignatures()[0].also { + it.formalParameters shouldBe listOf(a, b) + it.returnType shouldBe t + it.typeParameters shouldBe listOf(t, e) + it.thrownExceptions shouldBe listOf(e) - it.toString() shouldBe "p.Foo. method(A, B extends java.lang.Number) -> T" - } + it.toString() shouldBe "p.Foo. method(A, B extends java.lang.Number) -> T" + } - m.erasure.also { - it.formalParameters shouldBe listOf(a.erasure, b.erasure) - it.returnType shouldBe t.erasure - it.typeParameters shouldBe emptyList() - it.thrownExceptions shouldBe listOf(e.erasure) + m.erasure.also { + it.formalParameters shouldBe listOf(a.erasure, b.erasure) + it.returnType shouldBe t.erasure + it.typeParameters shouldBe emptyList() + it.thrownExceptions shouldBe listOf(e.erasure) - a.erasure shouldBe ts.OBJECT - b.erasure shouldBe java.lang.Number::class.java.decl - e.erasure shouldBe java.lang.RuntimeException::class.java.decl + a.erasure shouldBe ts.OBJECT + b.erasure shouldBe java.lang.Number::class.java.decl + e.erasure shouldBe java.lang.RuntimeException::class.java.decl - it.toString() shouldBe "p.Foo.method(java.lang.Object, java.lang.Number) -> java.lang.Object" - } + it.toString() shouldBe "p.Foo.method(java.lang.Object, java.lang.Number) -> java.lang.Object" } } } }) - - diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt index 8315a521c1..3366ce9ef6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SamTypesTest.kt @@ -12,12 +12,9 @@ import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec class SamTypesTest : ProcessorTestSpec({ - parserTest("Test SAM when some default overrides an abstract method") { - doTest { - val acu = parser.parse( - """ - + val acu = parser.parse( + """ interface Top { void accept(T t); } @@ -27,22 +24,17 @@ interface Sub extends Top { void accept(int i); // this is the single abstract method of Sub } + """.trimIndent() + ) - """.trimIndent() - ) + val (t_Top, t_Sub) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (topAccept, subAcceptOverride, subAccept) = acu.descendants(ASTMethodDeclaration::class.java) + .toList { it.genericSignature } - val (t_Top, t_Sub) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (topAccept, subAcceptOverride, subAccept) = acu.descendants(ASTMethodDeclaration::class.java) - .toList { it.genericSignature } - - TypeOps.findFunctionalInterfaceMethod(t_Top) shouldBe topAccept - - TypeOps.findFunctionalInterfaceMethod(t_Sub) shouldBe subAccept - - TypeOps.overrides(subAcceptOverride, topAccept, t_Sub) shouldBe true - } + TypeOps.findFunctionalInterfaceMethod(t_Top) shouldBe topAccept + TypeOps.findFunctionalInterfaceMethod(t_Sub) shouldBe subAccept + TypeOps.overrides(subAcceptOverride, topAccept, t_Sub) shouldBe true } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt index 13df3abf05..e8010b011a 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/SubstTest.kt @@ -15,56 +15,49 @@ import net.sourceforge.pmd.lang.java.ast.ASTClassType import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec class SubstTest : ProcessorTestSpec({ - - parserTest("Test full test case") { - doTest { - - val typeDecl = - parser.parse( - """ - package java.util; - - class Foo { - - Map, Map> field; - - } + val typeDecl = + parser.parse( """ - ).descendants(ASTClassDeclaration::class.java).firstOrThrow() + package java.util; - val typeDsl = typeDecl.typeDsl + class Foo { - val (k, f, c) = typeDecl.typeMirror.formalTypeParams + Map, Map> field; + } + """ + ).descendants(ASTClassDeclaration::class.java).firstOrThrow() + val typeDsl = typeDecl.typeDsl - val fieldT = typeDecl.descendants(ASTClassType::class.java).drop(2).firstOrThrow() + val (k, f, c) = typeDecl.typeMirror.formalTypeParams - val map = Map::class + val fieldT = typeDecl.descendants(ASTClassType::class.java).drop(2).firstOrThrow() - // assert the form of the type - fieldT shouldHaveType with(typeDsl) { - map[map[k, f], map[f, c]] - } + val map = Map::class - val `List{F}` = with(typeDsl) { List::class[f] } + // assert the form of the type + fieldT shouldHaveType with(typeDsl) { + map[map[k, f], map[f, c]] + } - val subst = - Substitution.mapping( - listOf(k, f), - listOf(`List{F}`, k) - ) + val `List{F}` = with(typeDsl) { List::class[f] } - subst.apply(f) shouldBe k - subst.apply(k) shouldBe `List{F}` + val subst = + Substitution.mapping( + listOf(k, f), + listOf(`List{F}`, k) + ) - val subbed = TypeOps.subst(fieldT.typeMirror, subst) + subst.apply(f) shouldBe k + subst.apply(k) shouldBe `List{F}` - subbed shouldBe with(typeDsl) { - map[map[`List{F}`, k], map[k, c]] - } + val subbed = TypeOps.subst(fieldT.typeMirror, subst) + + subbed shouldBe with(typeDsl) { + map[map[`List{F}`, k], map[k, c]] } } @@ -76,66 +69,53 @@ class SubstTest : ProcessorTestSpec({ operator fun Substitution.invoke(t: JTypeMirror) = TypeOps.subst(t, this) - parserTest("Test simple subst") { - doTest { + val (a, b, c) = makeDummyTVars("A", "B", "C") - val (a, b, c) = makeDummyTVars("A", "B", "C") - - with(TypeDslOf(a.typeSystem)) { - val `t_List{A}` = List::class[a] - val `t_Iter{B}` = Iterable::class[b] - val `t_Coll{C}` = Collection::class[c] + with(TypeDslOf(a.typeSystem)) { + val `t_List{A}` = List::class[a] + val `t_Iter{B}` = Iterable::class[b] + val `t_Coll{C}` = Collection::class[c] - val sub1 = subOf(a to `t_Iter{B}`) - val sub2 = subOf(b to `t_Coll{C}`) + val sub1 = subOf(a to `t_Iter{B}`) + val sub2 = subOf(b to `t_Coll{C}`) - val `t_List{Iter{B}}` = sub1(`t_List{A}`) + val `t_List{Iter{B}}` = sub1(`t_List{A}`) - `t_List{Iter{B}}` shouldBe List::class[Iterable::class[b]] + `t_List{Iter{B}}` shouldBe List::class[Iterable::class[b]] - val `t_List{Iter{t_Coll{C}}}` = sub2(`t_List{Iter{B}}`) + val `t_List{Iter{t_Coll{C}}}` = sub2(`t_List{Iter{B}}`) - `t_List{Iter{t_Coll{C}}}` shouldBe List::class[Iterable::class[Collection::class[c]]] + `t_List{Iter{t_Coll{C}}}` shouldBe List::class[Iterable::class[Collection::class[c]]] - val composed = sub1.andThen(sub2) + val composed = sub1.andThen(sub2) - composed.map should contain(a, Iterable::class[Collection::class[c]]) + composed.map should contain(a, Iterable::class[Collection::class[c]]) - composed.map.shouldContainExactly( - mapOf( - a to Iterable::class[Collection::class[c]], - b to `t_Coll{C}` - ) + composed.map.shouldContainExactly( + mapOf( + a to Iterable::class[Collection::class[c]], + b to `t_Coll{C}` ) + ) - composed(`t_List{A}`) shouldBe `t_List{Iter{t_Coll{C}}}` - } + composed(`t_List{A}`) shouldBe `t_List{Iter{t_Coll{C}}}` } - } parserTest("Test subst toString") { - doTest { + val (a, b, c) = makeDummyTVars("A", "B", "C") - val (a, b, c) = makeDummyTVars("A", "B", "C") - - with(TypeDslOf(a.typeSystem)) { - val `t_Iter{B}` = Iterable::class[b] - val `t_Coll{C}` = Collection::class[c] + with(TypeDslOf(a.typeSystem)) { + val `t_Iter{B}` = Iterable::class[b] + val `t_Coll{C}` = Collection::class[c] - val sub1 = subOf(a to `t_Iter{B}`, b to `t_Coll{C}`) + val sub1 = subOf(a to `t_Iter{B}`, b to `t_Coll{C}`) - sub1.toString() shouldBe "Substitution[A => java.lang.Iterable; B => java.util.Collection]" - } + sub1.toString() shouldBe "Substitution[A => java.lang.Iterable; B => java.util.Collection]" } - } - - }) - - diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt index 0a46893cfe..8b580b1182 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypesFromAstTest.kt @@ -15,64 +15,54 @@ import net.sourceforge.pmd.lang.java.ast.typeArgList * @author Clรฉment Fournier */ class TypesFromAstTest : ProcessorTestSpec({ - - parserTest("Test primitive types are reused") { - doTest { - val (tf1, tf2) = - parser.parse( - """ - package java.util; - - class Foo { - - class Inner { - - Foo.Inner f1; - /*Foo.*/Inner f2; - } - - } + val (tf1, tf2) = + parser.parse( """ - ) - .descendants(ASTFieldDeclaration::class.java) - .crossFindBoundaries() - .map { it.typeNode } - .toList() + package java.util; - tf1.shouldMatchN { + class Foo { + + class Inner { + + Foo.Inner f1; + /*Foo.*/Inner f2; + } - classType("Inner") { + } + """ + ) + .descendants(ASTFieldDeclaration::class.java) + .crossFindBoundaries() + .map { it.typeNode } + .toList() - it.typeMirror.toString() shouldBe "java.util.Foo#Inner" + tf1.shouldMatchN { + classType("Inner") { + it.typeMirror.toString() shouldBe "java.util.Foo#Inner" - classType("Foo") { - - it.typeMirror.toString() shouldBe "java.util.Foo" - - typeArgList { - classType("K") - } - } + classType("Foo") { + it.typeMirror.toString() shouldBe "java.util.Foo" typeArgList { - classType("T") + classType("K") } } + + typeArgList { + classType("T") + } } + } - tf2.shouldMatchN { + tf2.shouldMatchN { + classType("Inner") { + it.typeMirror.toString() shouldBe "java.util.Foo#Inner" - classType("Inner") { - - it.typeMirror.toString() shouldBe "java.util.Foo#Inner" - - typeArgList { - classType("T") - } + typeArgList { + classType("T") } } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 16e71682c5..79c2f470b6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -18,286 +18,268 @@ import net.sourceforge.pmd.lang.java.types.shouldHaveType class ConversionContextTests : ProcessorTestSpec({ parserTest("Test simple contexts") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - double foo() { - String.valueOf((Double) 1d); - return 2; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + double foo() { + String.valueOf((Double) 1d); + return 2; } - """ - ) + } + """ + ) - val (valueOf, _, doubleCast, doubleLit, intLit) = acu.descendants(ASTExpression::class.java).toList() + val (valueOf, _, doubleCast, doubleLit, intLit) = acu.descendants(ASTExpression::class.java).toList() - spy.shouldBeOk { - valueOf.conversionContext::isMissing shouldBe true - doubleCast.conversionContext::getTargetType shouldBe ts.OBJECT - doubleLit.conversionContext::getTargetType shouldBe double.box() - intLit.conversionContext::getTargetType shouldBe double - } + spy.shouldBeOk { + valueOf.conversionContext::isMissing shouldBe true + doubleCast.conversionContext::getTargetType shouldBe ts.OBJECT + doubleLit.conversionContext::getTargetType shouldBe double.box() + intLit.conversionContext::getTargetType shouldBe double } } parserTest("Test standalone ternary context") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - double foo() { - double r = true ? 1 : (short) 5; - return 2; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + double foo() { + double r = true ? 1 : (short) 5; + return 2; } - """ - ) + } + """ + ) - val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() + val (ternary, _, num1, shortCast, _) = acu.descendants(ASTExpression::class.java).toList() - spy.shouldBeOk { - // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe false - ternary.conversionContext::getTargetType shouldBe double + spy.shouldBeOk { + // ternary is in double assignment context + ternary.conversionContext::isMissing shouldBe false + ternary.conversionContext::getTargetType shouldBe double - // but it has type int - ternary shouldHaveType int + // but it has type int + ternary shouldHaveType int - // more importantly, both branch expressions have context int and not double + // more importantly, both branch expressions have context int and not double - num1 shouldHaveType int - shortCast shouldHaveType short + num1 shouldHaveType int + shortCast shouldHaveType short - num1.conversionContext::getTargetType shouldBe int - shortCast.conversionContext::getTargetType shouldBe int - } + num1.conversionContext::getTargetType shouldBe int + shortCast.conversionContext::getTargetType shouldBe int } } parserTest("Test standalone ternary context (2, boxing)") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - double foo(Integer i, Long l, boolean c) { - var z = c ? (Integer) null - : 4; - } - } - """ - ) - - val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() - - spy.shouldBeOk { - // ternary is in double assignment context - ternary.conversionContext::isMissing shouldBe true - ternary.conversionContext::getTargetType shouldBe null - - // but it has type int - ternary shouldHaveType int - - // more importantly, both branch expressions have context int and not double - - integerCast shouldHaveType int.box() - num4 shouldHaveType int - - integerCast.conversionContext::getTargetType shouldBe int - num4.conversionContext::getTargetType shouldBe int + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + double foo(Integer i, Long l, boolean c) { + var z = c ? (Integer) null + : 4; } } + """ + ) + + val (ternary, _, integerCast, _, num4) = acu.descendants(ASTExpression::class.java).toList() + + spy.shouldBeOk { + // ternary is in double assignment context + ternary.conversionContext::isMissing shouldBe true + ternary.conversionContext::getTargetType shouldBe null + + // but it has type int + ternary shouldHaveType int + + // more importantly, both branch expressions have context int and not double + + integerCast shouldHaveType int.box() + num4 shouldHaveType int + + integerCast.conversionContext::getTargetType shouldBe int + num4.conversionContext::getTargetType shouldBe int + } } + parserTest("Test context of assert stmt") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - static void m(Boolean boxedBool, boolean bool, String str) { - assert boxedBool; - assert bool : str; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + static void m(Boolean boxedBool, boolean bool, String str) { + assert boxedBool; + assert bool : str; } - """ - ) + } + """ + ) - val (boxedBool, bool, str) = acu.descendants(ASTVariableAccess::class.java).toList() + val (boxedBool, bool, str) = acu.descendants(ASTVariableAccess::class.java).toList() - spy.shouldBeOk { - boxedBool.conversionContext::getTargetType shouldBe ts.BOOLEAN - bool.conversionContext::getTargetType shouldBe ts.BOOLEAN - str.conversionContext::getTargetType shouldBe ts.STRING - } + spy.shouldBeOk { + boxedBool.conversionContext::getTargetType shouldBe ts.BOOLEAN + bool.conversionContext::getTargetType shouldBe ts.BOOLEAN + str.conversionContext::getTargetType shouldBe ts.STRING } } parserTest("Test context of statements with conditions") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { - if (boxedBool); - while (boxedBool); - for (int i = 0; boxedBool; i++) {} - do; while (boxedBool); - for (int i : ints); - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { + if (boxedBool); + while (boxedBool); + for (int i = 0; boxedBool; i++) {} + do; while (boxedBool); + for (int i : ints); } - """ - ) + } + """ + ) - val (ifstmt, whilestmt, forstmt, _, dostmt, foreachstmt) = acu.descendants(ASTVariableAccess::class.java) - .toList() - val forUpdate = acu.descendants(ASTForUpdate::class.java).firstOrThrow().exprList[0] + val (ifstmt, whilestmt, forstmt, _, dostmt, foreachstmt) = acu.descendants(ASTVariableAccess::class.java) + .toList() + val forUpdate = acu.descendants(ASTForUpdate::class.java).firstOrThrow().exprList[0] - spy.shouldBeOk { + spy.shouldBeOk { - ifstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - whilestmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - forstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - dostmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + ifstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + whilestmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + forstmt.conversionContext::getTargetType shouldBe ts.BOOLEAN + dostmt.conversionContext::getTargetType shouldBe ts.BOOLEAN - forUpdate.conversionContext::getTargetType shouldBe null - foreachstmt.conversionContext::getTargetType shouldBe null - } + forUpdate.conversionContext::getTargetType shouldBe null + foreachstmt.conversionContext::getTargetType shouldBe null } } parserTest("Test missing context in qualifier") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Scratch { - static void m(Boolean boxedBool) { - ((Boolean) boxedBool).booleanValue(); - ((Object) boxedBool).somefield; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(Boolean boxedBool) { + ((Boolean) boxedBool).booleanValue(); + ((Object) boxedBool).somefield; } - """ - ) + } + """ + ) - val (booleanCast, objectCast) = acu.descendants(ASTCastExpression::class.java).toList() + val (booleanCast, objectCast) = acu.descendants(ASTCastExpression::class.java).toList() - spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe null - objectCast.conversionContext::getTargetType shouldBe null - } + spy.shouldBeOk { + booleanCast.conversionContext::getTargetType shouldBe null + objectCast.conversionContext::getTargetType shouldBe null } } parserTest("Test context of ternary condition") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Scratch { - static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { - str = (boolean) boxedBool ? "a" : "b"; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(Boolean boxedBool, boolean bool, String str, int[] ints) { + str = (boolean) boxedBool ? "a" : "b"; } - """ - ) + } + """ + ) - val (booleanCast) = acu.descendants(ASTCastExpression::class.java).toList() + val (booleanCast) = acu.descendants(ASTCastExpression::class.java).toList() - spy.shouldBeOk { - booleanCast.conversionContext::getTargetType shouldBe boolean - } + spy.shouldBeOk { + booleanCast.conversionContext::getTargetType shouldBe boolean } } parserTest("Test numeric context") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Scratch { - static void m() { - int i, j, k; - double d, e; - - eat(i * j); - eat(i << j); - eat(i & j); + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m() { + int i, j, k; + double d, e; + + eat(i * j); + eat(i << j); + eat(i & j); - eat(i + e); - eat(i * e); - } - void eat(double d) {} + eat(i + e); + eat(i * e); } - """ - ) + void eat(double d) {} + } + """ + ) - val (mulint, lshift, and, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() + val (mulint, lshift, and, plusdouble, muldouble) = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - listOf(mulint, lshift, and).forEach { - withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.INT - it.rightOperand.conversionContext::getTargetType shouldBe ts.INT - } + spy.shouldBeOk { + listOf(mulint, lshift, and).forEach { + withClue(it) { + it.leftOperand.conversionContext::getTargetType shouldBe ts.INT + it.rightOperand.conversionContext::getTargetType shouldBe ts.INT } - listOf(plusdouble, muldouble).forEach { - withClue(it) { - it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE - it.rightOperand.conversionContext::getTargetType shouldBe ts.DOUBLE - } + } + listOf(plusdouble, muldouble).forEach { + withClue(it) { + it.leftOperand.conversionContext::getTargetType shouldBe ts.DOUBLE + it.rightOperand.conversionContext::getTargetType shouldBe ts.DOUBLE } } } } + parserTest("String contexts") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Scratch { - static void m(int i) { - eat(" " + i); - eat(i + " "); - eat(" " + " "); - eat(" " + i + i); - } - void eat(Object d) {} + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(int i) { + eat(" " + i); + eat(i + " "); + eat(" " + " "); + eat(" " + i + i); } - """ - ) + void eat(Object d) {} + } + """ + ) - val concats = acu.descendants(ASTInfixExpression::class.java).toList() + val concats = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - concats.forEach { - withClue(it) { - JavaAstUtils.isStringConcatExpr(it) shouldBe true - it.leftOperand.conversionContext::getTargetType shouldBe ts.STRING - it.rightOperand.conversionContext::getTargetType shouldBe ts.STRING - } + spy.shouldBeOk { + concats.forEach { + withClue(it) { + JavaAstUtils.isStringConcatExpr(it) shouldBe true + it.leftOperand.conversionContext::getTargetType shouldBe ts.STRING + it.rightOperand.conversionContext::getTargetType shouldBe ts.STRING } } } } parserTest("Relational ops") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Scratch { - static void m(int i) { - eat(i < i++); //l0 - eat(i > (long) i); //l1 - } - void eat(Object d) {} + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(int i) { + eat(i < i++); //l0 + eat(i > (long) i); //l1 } - """ - ) + void eat(Object d) {} + } + """ + ) - val (l0, l1) = acu.descendants(ASTInfixExpression::class.java).toList() + val (l0, l1) = acu.descendants(ASTInfixExpression::class.java).toList() - spy.shouldBeOk { - l0.leftOperand.conversionContext::getTargetType shouldBe int - l0.rightOperand.conversionContext::getTargetType shouldBe int + spy.shouldBeOk { + l0.leftOperand.conversionContext::getTargetType shouldBe int + l0.rightOperand.conversionContext::getTargetType shouldBe int - l1.leftOperand.conversionContext::getTargetType shouldBe long - l1.rightOperand.conversionContext::getTargetType shouldBe long - } + l1.leftOperand.conversionContext::getTargetType shouldBe long + l1.rightOperand.conversionContext::getTargetType shouldBe long } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt index 25a13c161f..347ef12680 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/AnonCtorsTest.kt @@ -16,61 +16,57 @@ import net.sourceforge.pmd.lang.java.types.* */ @Suppress("UNUSED_VARIABLE") class AnonCtorsTest : ProcessorTestSpec({ - - parserTest("Diamond anonymous class constructor") { - doTest { - val acu = parser.parse( - """ - class Scratch { - - interface Gen { T get(); } - - static T useGen(Gen t_Gen) { - return t_Gen.get(); - } - - { - Integer result2 = useGen(new Gen<>() { public Integer get() { return 1; } }); - } - } + val acu = parser.parse( """ - ) + class Scratch { - val (t_Scratch, t_Gen, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + interface Gen { T get(); } - val call = acu.descendants(ASTMethodCall::class.java).get(1)!! + static T useGen(Gen t_Gen) { + return t_Gen.get(); + } - call.shouldMatchN { - methodCall("useGen") { + { + Integer result2 = useGen(new Gen<>() { public Integer get() { return 1; } }); + } + } + """ + ) - it.methodType.formalParameters.shouldBe(listOf(with(it.typeDsl) { - t_Gen[`?` extends int.box()] // Gen - })) + val (t_Scratch, t_Gen, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - argList { - constructorCall { - classType("Gen") { - it shouldHaveType t_Gen.erasure - diamond() + val call = acu.descendants(ASTMethodCall::class.java).get(1)!! + + call.shouldMatchN { + methodCall("useGen") { + + it.methodType.formalParameters.shouldBe(listOf(with(it.typeDsl) { + t_Gen[`?` extends int.box()] // Gen + })) + + argList { + constructorCall { + classType("Gen") { + it shouldHaveType t_Gen.erasure + diamond() + } + + argList(0) + + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = ts.OBJECT, + withFormals = emptyList(), + returning = t_Gen[int.box()] // Gen + ).also { + it.symbol shouldBe ts.OBJECT.symbol.constructors[0] } + } - argList(0) - - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = ts.OBJECT, - withFormals = emptyList(), - returning = t_Gen[int.box()] // Gen - ).also { - it.symbol shouldBe ts.OBJECT.symbol.constructors[0] - } - } - - child(ignoreChildren = true) { - it shouldHaveType t_Anon - } + child(ignoreChildren = true) { + it shouldHaveType t_Anon } } } @@ -78,421 +74,394 @@ class AnonCtorsTest : ProcessorTestSpec({ } } - parserTest("Test anonymous interface constructor") { - doTest { - val acu = parser.parse( - """ - class Scratch { - public interface BitMetric { - public double getBitLength(int value); - } - - private final BitMetric t_BitMetric = new BitMetric() { - public double getBitLength(int value) { - return value; - } - }; - } + val acu = parser.parse( """ - ) + class Scratch { + public interface BitMetric { + public double getBitLength(int value); + } - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) - .toList { it.typeMirror } - - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - - call.shouldMatchN { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } - - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = ts.OBJECT, - withFormals = emptyList(), - returning = t_BitMetric - ).also { - it.symbol shouldBe ts.OBJECT.symbol.constructors[0] - } - } - it shouldHaveType t_BitMetric - - argList {} - - child(ignoreChildren = true) {} + private final BitMetric t_BitMetric = new BitMetric() { + public double getBitLength(int value) { + return value; } + }; + } + """ + ) + + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } + + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + + call.shouldMatchN { + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol + } + + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = ts.OBJECT, + withFormals = emptyList(), + returning = t_BitMetric + ).also { + it.symbol shouldBe ts.OBJECT.symbol.constructors[0] + } + } + it shouldHaveType t_BitMetric + + argList {} + + child(ignoreChildren = true) {} } } } - parserTest("Test anonymous class constructor") { - doTest { - val acu = parser.parse( - """ - class Scratch { - public abstract class BitMetric { - public BitMetric(int i) {} + val acu = parser.parse( + """ + class Scratch { + public abstract class BitMetric { + public BitMetric(int i) {} - public abstract double getBitLength(int value); + public abstract double getBitLength(int value); + } + + private final BitMetric t_BitMetric = new BitMetric(4) { + public double getBitLength(int value) { + return value; + } + }; + } + """ + ) + + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } + + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + + call.shouldMatchN { + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol } - private final BitMetric t_BitMetric = new BitMetric(4) { - public double getBitLength(int value) { - return value; + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_BitMetric, + withFormals = listOf(int), + returning = t_BitMetric + ).also { + it.symbol shouldBe t_BitMetric.symbol.constructors[0] } - }; - } - """ - ) + } - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) - .toList { it.typeMirror } + argList { + int(4) + } - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though - call.shouldMatchN { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } - - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_BitMetric, - withFormals = listOf(int), - returning = t_BitMetric - ).also { - it.symbol shouldBe t_BitMetric.symbol.constructors[0] - } - } - - argList { - int(4) - } - - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though - - } } } } } parserTest("Test qualified anonymous class constructor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - - class Scratch { - - class Inner {} - - public static void main(String[] args) { - new Scratch().new Inner() { - - }; - } - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ - ) - val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + class Scratch { - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + class Inner {} - spy.shouldBeOk { - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) + public static void main(String[] args) { + new Scratch().new Inner() { - it shouldHaveType t_Inner - - t_Inner.shouldBeA { - it.enclosingType shouldBe t_Scratch - } - - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Inner, - withFormals = emptyList(), - returning = t_Inner - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } - - - argList(0) - - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though - } - } - } + }; } } - } + """ + ) + val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - parserTest("Test qualified diamond anonymous class constructor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - - class Scratch { - - class Inner {} - - public void main(String[] args) { - // note: this is invalid, because the Scratch<> diamond doesn't have context - // Inner invalid = new Scratch<>().new Inner<>() {}; - - Scratch s = null; // this type node needs to be disambiged early - Inner invalid = s.new Inner<>() { - - }; - } - } - """ - ) - - val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - - spy.shouldBeOk { - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) - - it shouldHaveType t_Inner[gen.t_String] - - t_Inner.shouldBeA { - it.enclosingType shouldBe t_Scratch - } - - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Inner[gen.t_String], - withFormals = emptyList(), - returning = t_Inner[gen.t_String] - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } - - - argList(0) - - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though - } - } - } - } - } - } - - - - parserTest("Test qualified diamond anonymous class constructor, depending on disambig in sibling tree") { - doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - - package p.q; - - class Scratch { - - class Inner extends Foo { } - - public void main(String[] args) { - // getScratch's return type is ambiguous, it needs to be disambiged - // before the symbol table for inherited members of the new Inner is - // set, otherwise we don't know the actual type of the LHS - Scratch.Inner invalid = Foo.getScratch().new Inner<>() { - // stuff inherited here needs - { - // fooField is inherited through superclass Foo - // it's declared later in the compilation unit - fooField.toString(); - } - }; - } - - static class Foo { - - // this return type is ambiguous - static p.q.Scratch getScratch() { return new Scratch<>(); } - - Q fooField; - } - } - """ - ) - - val (t_Scratch, t_Inner, t_Anon, t_Foo) = acu.declaredTypeSignatures() - - - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - val fieldAccess = acu.descendants(ASTVariableAccess::class.java).crossFindBoundaries().firstOrThrow() - - spy.shouldBeOk { - - // Scratch.Inner - val innerT = t_Scratch[int.box()] / t_Inner[gen.t_String] - - call.shouldMatchN { - constructorCall { - unspecifiedChildren(2) - - - it shouldHaveType innerT - - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = innerT, - withFormals = emptyList(), - returning = innerT - ).also { - it.symbol shouldBe t_Inner.symbol.constructors[0] - } - - - argList(0) - - child(ignoreChildren = true) { - it shouldHaveType t_Anon // though - } - } - } - - fieldAccess.shouldMatchN { - variableAccess("fooField") { - it shouldHaveType int.box() - } - } - } - } - } - - - - parserTest("Test anonymous interface constructor in invocation ctx") { - doTest { - - val acu = parser.parse( - """ - class Scratch { - public interface BitMetric { - public double getBitLength(int value); - } - - static T generic(T t) { return t; } - - private final BitMetric t_BitMetric = generic(new BitMetric() { - public double getBitLength(int value) { - return value; - } - }); - } - """ - ) - - val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) - .toList { it.typeMirror } - - - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - + spy.shouldBeOk { call.shouldMatchN { - methodCall("generic") { + constructorCall { + unspecifiedChildren(2) + + it shouldHaveType t_Inner + + t_Inner.shouldBeA { + it.enclosingType shouldBe t_Scratch + } it.methodType.shouldMatchMethod( - named = "generic", - declaredIn = t_Scratch, - withFormals = listOf(t_BitMetric), - returning = t_BitMetric - ) + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Inner, + withFormals = emptyList(), + returning = t_Inner + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } - argList { - constructorCall { - classType("BitMetric") { - it.typeMirror.symbol shouldBe t_BitMetric.symbol - } + argList(0) - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = call.typeSystem.OBJECT, - withFormals = emptyList(), - returning = t_BitMetric - ).also { - it.symbol shouldBe call.typeSystem.OBJECT.symbol.constructors[0] - } - - it shouldHaveType t_BitMetric - - argList {} - - child(ignoreChildren = true) {} - } + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though } } } } } + parserTest("Test qualified diamond anonymous class constructor") { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + + class Scratch { + + class Inner {} + + public void main(String[] args) { + // note: this is invalid, because the Scratch<> diamond doesn't have context + // Inner invalid = new Scratch<>().new Inner<>() {}; + + Scratch s = null; // this type node needs to be disambiged early + Inner invalid = s.new Inner<>() { + + }; + } + } + """ + ) + + val (t_Scratch, t_Inner, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + + spy.shouldBeOk { + call.shouldMatchN { + constructorCall { + unspecifiedChildren(2) + + it shouldHaveType t_Inner[gen.t_String] + + t_Inner.shouldBeA { + it.enclosingType shouldBe t_Scratch + } + + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Inner[gen.t_String], + withFormals = emptyList(), + returning = t_Inner[gen.t_String] + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } + + + argList(0) + + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } + } + } + } + } + + parserTest("Test qualified diamond anonymous class constructor, depending on disambig in sibling tree") { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + + package p.q; + + class Scratch { + + class Inner extends Foo { } + + public void main(String[] args) { + // getScratch's return type is ambiguous, it needs to be disambiged + // before the symbol table for inherited members of the new Inner is + // set, otherwise we don't know the actual type of the LHS + Scratch.Inner invalid = Foo.getScratch().new Inner<>() { + // stuff inherited here needs + { + // fooField is inherited through superclass Foo + // it's declared later in the compilation unit + fooField.toString(); + } + }; + } + + static class Foo { + + // this return type is ambiguous + static p.q.Scratch getScratch() { return new Scratch<>(); } + + Q fooField; + } + } + """ + ) + + val (t_Scratch, t_Inner, t_Anon, t_Foo) = acu.declaredTypeSignatures() + + + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + val fieldAccess = acu.descendants(ASTVariableAccess::class.java).crossFindBoundaries().firstOrThrow() + + spy.shouldBeOk { + + // Scratch.Inner + val innerT = t_Scratch[int.box()] / t_Inner[gen.t_String] + + call.shouldMatchN { + constructorCall { + unspecifiedChildren(2) + + + it shouldHaveType innerT + + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = innerT, + withFormals = emptyList(), + returning = innerT + ).also { + it.symbol shouldBe t_Inner.symbol.constructors[0] + } + + + argList(0) + + child(ignoreChildren = true) { + it shouldHaveType t_Anon // though + } + } + } + + fieldAccess.shouldMatchN { + variableAccess("fooField") { + it shouldHaveType int.box() + } + } + } + } + + parserTest("Test anonymous interface constructor in invocation ctx") { + val acu = parser.parse( + """ + class Scratch { + public interface BitMetric { + public double getBitLength(int value); + } + + static T generic(T t) { return t; } + + private final BitMetric t_BitMetric = generic(new BitMetric() { + public double getBitLength(int value) { + return value; + } + }); + } + """ + ) + + val (t_Scratch, t_BitMetric, t_Anon) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } + + + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + + call.shouldMatchN { + methodCall("generic") { + + it.methodType.shouldMatchMethod( + named = "generic", + declaredIn = t_Scratch, + withFormals = listOf(t_BitMetric), + returning = t_BitMetric + ) + + argList { + + constructorCall { + classType("BitMetric") { + it.typeMirror.symbol shouldBe t_BitMetric.symbol + } + + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = call.typeSystem.OBJECT, + withFormals = emptyList(), + returning = t_BitMetric + ).also { + it.symbol shouldBe call.typeSystem.OBJECT.symbol.constructors[0] + } + + it shouldHaveType t_BitMetric + + argList {} + + child(ignoreChildren = true) {} + } + } + } + } + } parserTest("Test new method in anonymous class") { - doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - interface Scratch { - - int k = new Scratch() { - int someNewMethod() { return 2; } - }.someNewMethod(); - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ - ) + interface Scratch { - val (t_Scratch, t_Anon) = acu.declaredTypeSignatures() + int k = new Scratch() { + int someNewMethod() { return 2; } + }.someNewMethod(); + } + """ + ) - val (methodDecl) = acu.declaredMethodSignatures() - val call = acu.firstMethodCall() + val (t_Scratch, t_Anon) = acu.declaredTypeSignatures() - methodDecl.modifiers shouldBe 0 + val (methodDecl) = acu.declaredMethodSignatures() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("someNewMethod") { + methodDecl.modifiers shouldBe 0 - it.qualifier!! shouldHaveType t_Scratch - it.methodType shouldBeSomeInstantiationOf methodDecl + spy.shouldBeOk { + call.shouldMatchN { + methodCall("someNewMethod") { - it::getQualifier shouldBe unspecifiedChild() + it.qualifier!! shouldHaveType t_Scratch + it.methodType shouldBeSomeInstantiationOf methodDecl - argList(0) - } + it::getQualifier shouldBe unspecifiedChild() + + argList(0) } } } } parserTest("Anon in anon") { - doTest { - // this used to be a stackoverflow + // this used to be a stackoverflow - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ public class InputMissingOverrideBadAnnotation { Runnable r = new Runnable() { @@ -506,23 +475,21 @@ class AnonCtorsTest : ProcessorTestSpec({ }; } """ - ) + ) - val call = acu.firstCtorCall() - .firstCtorCall() + val call = acu.firstCtorCall() + .firstCtorCall() - spy.shouldBeOk { - call shouldHaveType java.lang.Throwable::class.decl - } + spy.shouldBeOk { + call shouldHaveType java.lang.Throwable::class.decl } } parserTest("Disambiguation of foreach when deferred") { - doTest { - enableProcessing() + enableProcessing() - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package p; import java.util.function.Consumer; class Assert { @@ -538,22 +505,20 @@ class Assert { static void foo(T a, Consumer i) {} } - """ - ) + """ + ) - spy.shouldBeOk { - acu.descendants(ASTConstructorCall::class.java) - .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] - } + spy.shouldBeOk { + acu.descendants(ASTConstructorCall::class.java) + .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] } } parserTest("Disambiguation of when deferred, local var decl") { - doTest { - enableProcessing() + enableProcessing() - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package p; import java.util.function.Consumer; class Assert { @@ -564,13 +529,12 @@ class Assert { static void foo(T a, Consumer i) {} } - """ - ) + """ + ) - spy.shouldBeOk { - acu.descendants(ASTConstructorCall::class.java) - .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] - } + spy.shouldBeOk { + acu.descendants(ASTConstructorCall::class.java) + .firstOrThrow() shouldHaveType java.util.function.Consumer::class[gen.t_String] } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt index cf75a42113..51eb5943df 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/BranchingExprsTests.kt @@ -19,15 +19,12 @@ class BranchingExprsTests : ProcessorTestSpec({ java.util.function.Supplier::class[gen.t_String] } - parserTest("Test ternary lets context flow") { - + parserTestContainer("Test ternary lets context flow") { asIfIn(TypeInferenceTestCases::class.java) inContext(ExpressionParsingCtx) { - "makeThree(true ? () -> \"foo\" : () -> \"bar\")" should parseAs { methodCall("makeThree") { - argList { ternaryExpr { boolean(true) @@ -48,15 +45,11 @@ class BranchingExprsTests : ProcessorTestSpec({ } } - parserTest("Test ternary infers outer stuff") { - + parserTestContainer("Test ternary infers outer stuff") { asIfIn(TypeInferenceTestCases::class.java) inContext(ExpressionParsingCtx) { - - "makeThree(true ? () -> \"foo\" : () -> \"bar\")" should parseAs { - methodCall("makeThree") { argList { ternaryExpr { @@ -78,13 +71,11 @@ class BranchingExprsTests : ProcessorTestSpec({ } } - parserTest("Test ternary without context lubs params") { - + parserTestContainer("Test ternary without context lubs params") { otherImports += "java.util.ArrayList" otherImports += "java.util.LinkedList" inContext(StatementParsingCtx) { - "var ter = true ? new ArrayList() : new LinkedList();" should parseAs { localVarDecl { @@ -114,14 +105,12 @@ class BranchingExprsTests : ProcessorTestSpec({ } } - parserTest("Test switch without context lubs params") { - + parserTestContainer("Test switch without context lubs params") { otherImports += "java.util.ArrayList" otherImports += "java.util.LinkedList" otherImports += "java.util.Collections" inContext(StatementParsingCtx) { - """ var ter = switch(foo) { case 1 -> new ArrayList(); @@ -183,10 +172,8 @@ class BranchingExprsTests : ProcessorTestSpec({ } } - parserTest("Test ternary without context promotes primitives") { - + parserTestContainer("Test ternary without context promotes primitives") { inContext(StatementParsingCtx) { - "var ter = true ? 1 : 3;" should parseAs { localVarDecl { modifiers { } @@ -237,11 +224,8 @@ class BranchingExprsTests : ProcessorTestSpec({ } } - - parserTest("Cast context doesn't influence standalone ternary") { - doTest { - val acu = parser.parse( + val acu = parser.parse( """ class Scratch { @@ -250,27 +234,23 @@ class Scratch { } } - """.trimIndent() - ) + """.trimIndent() + ) - val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() - ternary.shouldMatchN { - ternaryExpr { - it.typeMirror.shouldBePrimitive(INT) - variableAccess("val") - int(1) - int(0) - } + ternary.shouldMatchN { + ternaryExpr { + it.typeMirror.shouldBePrimitive(INT) + variableAccess("val") + int(1) + int(0) } } } - - parserTest("Cast context doesn't provide target type (only for lambdas)") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.Collection; import java.util.List; @@ -293,21 +273,19 @@ class Scratch { List emptyList() {return null;} Set emptySet() {return null;} } - """.trimIndent() - ) + """.trimIndent() + ) - val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - ternary1 shouldHaveType gen.t_Collection[captureMatcher(`?`)] // java.util.Collection - ternary2 shouldHaveType gen.`t_Collection{String}` // java.util.Collection - } + spy.shouldBeOk { + ternary1 shouldHaveType gen.t_Collection[captureMatcher(`?`)] // java.util.Collection + ternary2 shouldHaveType gen.`t_Collection{String}` // java.util.Collection } } parserTest("Null branches produce null type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.Collection; class Test { @@ -318,24 +296,20 @@ class Scratch { return (Collection) (messageSelector ? null : null); } } - """.trimIndent() + """.trimIndent() ) - val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (ternary1, ternary2) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - ternary1 shouldHaveType java.util.Collection::class[ts.STRING] - ternary2 shouldHaveType ts.NULL_TYPE - } + spy.shouldBeOk { + ternary1 shouldHaveType java.util.Collection::class[ts.STRING] + ternary2 shouldHaveType ts.NULL_TYPE } } - parserTest("Assignment context doesn't influence standalone ternary") { - - + parserTestContainer("Assignment context doesn't influence standalone ternary") { inContext(StatementParsingCtx) { - "double ter = true ? 1 : 3;" should parseAs { localVarDecl { modifiers { } @@ -410,10 +384,8 @@ class Scratch { } } - parserTest("Reference ternary with context has type of its target") { - + parserTestContainer("Reference ternary with context has type of its target") { inContext(StatementParsingCtx) { - "Object ter = true ? String.valueOf(1) : String.valueOf(2);" should parseAs { localVarDecl { modifiers { } @@ -470,5 +442,4 @@ class Scratch { } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt index 1527626869..cb4620c2bb 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CaptureInferenceTest.kt @@ -21,42 +21,38 @@ import java.util.stream.Collectors class CaptureInferenceTest : ProcessorTestSpec({ parserTest("Test capture incompatibility recovery") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Archive { void something(java.util.List l) { l.set(1, l.get(0)); // captured, fails } } - """.trimIndent() + """.trimIndent() + ) + + val setCall = acu.firstMethodCall() + val getCall = setCall.arguments[1] as ASTMethodCall + + spy.shouldHaveMissingCtDecl(setCall) + + acu.withTypeDsl { + val capture1 = captureMatcher(`?`) + getCall.methodType.shouldMatchMethod( + named = "get", + declaredIn = gen.t_List[capture1], + withFormals = listOf(int), + returning = capture1 ) - val setCall = acu.firstMethodCall() - val getCall = setCall.arguments[1] as ASTMethodCall - - spy.shouldHaveMissingCtDecl(setCall) - - acu.withTypeDsl { - val capture1 = captureMatcher(`?`) - getCall.methodType.shouldMatchMethod( - named = "get", - declaredIn = gen.t_List[capture1], - withFormals = listOf(int), - returning = capture1 - ) - - setCall.methodType shouldBe ts.UNRESOLVED_METHOD - } + setCall.methodType shouldBe ts.UNRESOLVED_METHOD } } parserTest("Test lower wildcard compatibility") { - doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package java.lang; import java.util.Iterator; @@ -72,23 +68,21 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent() - ) + """.trimIndent() + ) - val tVar = acu.typeVar("T") - val call = acu.firstMethodCall() + val tVar = acu.typeVar("T") + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType void - call.arguments[0] shouldHaveType tVar - } + spy.shouldBeOk { + call shouldHaveType void + call.arguments[0] shouldHaveType tVar } } parserTest("Test method ref on captured thing") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; import java.util.ArrayList; import java.util.Comparator; @@ -101,41 +95,40 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent() - ) + """.trimIndent() + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("sort") { - it shouldHaveType void + spy.shouldBeOk { + call.shouldMatchN { + methodCall("sort") { + it shouldHaveType void - variableAccess("statList") {} - argList { - methodCall("comparingInt") { - // eg. java.util.Comparator + variableAccess("statList") {} + argList { + methodCall("comparingInt") { + // eg. java.util.Comparator - val captureOfString = captureMatcher(`?` extends gen.t_String) + val captureOfString = captureMatcher(`?` extends gen.t_String) - it shouldHaveType gen.t_Comparator[captureOfString] + it shouldHaveType gen.t_Comparator[captureOfString] - it.methodType.shouldMatchMethod( - named = "comparingInt", - declaredIn = gen.t_Comparator, - withFormals = listOf(ToIntFunction::class[`?` `super` captureOfString]), - returning = gen.t_Comparator[captureOfString] - ) + it.methodType.shouldMatchMethod( + named = "comparingInt", + declaredIn = gen.t_Comparator, + withFormals = listOf(ToIntFunction::class[`?` `super` captureOfString]), + returning = gen.t_Comparator[captureOfString] + ) - unspecifiedChild() + unspecifiedChild() - argList { - methodRef("hashCode") { - unspecifiedChild() + argList { + methodRef("hashCode") { + unspecifiedChild() - it.referencedMethod shouldBe ts.OBJECT.getMethodsByName("hashCode").single() - it shouldHaveType ToIntFunction::class[captureOfString] - } + it.referencedMethod shouldBe ts.OBJECT.getMethodsByName("hashCode").single() + it shouldHaveType ToIntFunction::class[captureOfString] } } } @@ -146,9 +139,8 @@ class CaptureInferenceTest : ProcessorTestSpec({ } parserTest("Test independent captures merging") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.*; class Scratch { @@ -163,34 +155,31 @@ class CaptureInferenceTest : ProcessorTestSpec({ } } - """.trimIndent() + """.trimIndent() + ) + + val tvar = acu.typeVar("T") + val call = acu.firstMethodCall() + val reqnonnull = call.arguments[0] as ASTMethodCall + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "spliterator0", + withFormals = listOf(gen.t_Collection[`?` extends tvar], int), + returning = Spliterator::class[tvar] ) - val tvar = acu.typeVar("T") - val call = acu.firstMethodCall() - val reqnonnull = call.arguments[0] as ASTMethodCall + val capture = captureMatcher(`?` extends tvar) + reqnonnull shouldHaveType gen.t_Collection[capture] + reqnonnull.methodType.shouldMatchMethod(named = "requireNonNull", declaredIn = Objects::class.raw) - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "spliterator0", - withFormals = listOf(gen.t_Collection[`?` extends tvar], int), - returning = Spliterator::class[tvar] - ) - - val capture = captureMatcher(`?` extends tvar) - reqnonnull shouldHaveType gen.t_Collection[capture] - reqnonnull.methodType.shouldMatchMethod(named = "requireNonNull", declaredIn = Objects::class.raw) - - reqnonnull.arguments[0] shouldHaveType gen.t_Collection[capture] - } + reqnonnull.arguments[0] shouldHaveType gen.t_Collection[capture] } } - parserTest("Problem with GLB of several capture variables") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.HashMap; import java.util.Map; import java.util.function.Function; @@ -207,58 +196,56 @@ class CaptureInferenceTest : ProcessorTestSpec({ } - """.trimIndent() - ) + """.trimIndent() + ) - /* Signature of the other groupingBy: + /* Signature of the other groupingBy: - public static > + public static > - Collector groupingBy(Function classifier, - Supplier mapFactory, - Collector downstream) - */ + Collector groupingBy(Function classifier, + Supplier mapFactory, + Collector downstream) + */ - val (tvar, kvar, avar, dvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).first()!! + val (tvar, kvar, avar, dvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).first()!! - call.shouldMatchN { - methodCall("groupingBy") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = "groupingBy", - declaredIn = Collectors::class.raw, - withFormals = listOf( - gen.t_Function[`?` `super` tvar, `?` extends kvar], - Supplier::class[gen.t_Map[kvar, dvar]], - Collector::class[`?` `super` tvar, avar, dvar] - ), - returning = Collector::class[tvar, `?`, gen.t_Map[kvar, dvar]] - ) - } + call.shouldMatchN { + methodCall("groupingBy") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "groupingBy", + declaredIn = Collectors::class.raw, + withFormals = listOf( + gen.t_Function[`?` `super` tvar, `?` extends kvar], + Supplier::class[gen.t_Map[kvar, dvar]], + Collector::class[`?` `super` tvar, avar, dvar] + ), + returning = Collector::class[tvar, `?`, gen.t_Map[kvar, dvar]] + ) + } - skipQualifier() + skipQualifier() - argList { - variableAccess("classifier") + argList { + variableAccess("classifier") - constructorRef { - // HMM this should be HashMap - typeExpr { - classType("HashMap") - } + constructorRef { + // HMM this should be HashMap + typeExpr { + classType("HashMap") } - - variableAccess("downstream") } + + variableAccess("downstream") } } } } parserTest("Capture vars should be exploded in typeArgsContains") { - doTest { - /* + /* Phase STRICT, NodeStream. union(java.lang.Iterable>) -> NodeStream Context 4, union(java.lang.Iterable>) -> NodeStream<ฮด> ARGUMENTS @@ -309,9 +296,9 @@ class CaptureInferenceTest : ProcessorTestSpec({ This means we must crack the cvar in TypeOps::typeArgContains. Possibly, this could be recursive and lead to stackoverflow? Idk - */ + */ - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.Arrays; @@ -329,20 +316,17 @@ interface NodeStream { } """.trimIndent() - ) + ) - val (_, unionOfIter) = acu.methodDeclarations().toList { it.genericSignature } + val (_, unionOfIter) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(unionOfIter) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(unionOfIter) } } - parserTest("Ivar should be instantiated with lower not upper bound") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ interface MostlySingularMultimap { @@ -369,20 +353,17 @@ interface MostlySingularMultimap { } """.trimIndent() - ) + ) - val (_, _, lastGroupBy) = acu.methodDeclarations().toList { it.genericSignature } + val (_, _, lastGroupBy) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(lastGroupBy) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(lastGroupBy) } } - parserTest("Unbounded wild has bound of its underlying tvar") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.List; @@ -397,18 +378,15 @@ class Scratch> { } } """.trimIndent() - ) + ) - spy.shouldBeOk { - acu.firstMethodCall().methodType - } + spy.shouldBeOk { + acu.firstMethodCall().methodType } } - parserTest("Array access should be captured") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ class CompletableFuture { @@ -422,30 +400,27 @@ class CompletableFuture { } """.trimIndent() + ) + + val t_CompletableFuture = acu.firstTypeSignature() + + spy.shouldBeOk { + val captureMatcher = captureMatcher(`?`) + + val arrType = acu.descendants(ASTArrayAccess::class.java).firstOrThrow().typeMirror + + arrType shouldBe t_CompletableFuture[captureMatcher] + + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "uniCopyStage", + withFormals = listOf(t_CompletableFuture[captureMatcher]), + returning = t_CompletableFuture[ts.OBJECT] ) - - val t_CompletableFuture = acu.firstTypeSignature() - - spy.shouldBeOk { - val captureMatcher = captureMatcher(`?`) - - val arrType = acu.descendants(ASTArrayAccess::class.java).firstOrThrow().typeMirror - - arrType shouldBe t_CompletableFuture[captureMatcher] - - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "uniCopyStage", - withFormals = listOf(t_CompletableFuture[captureMatcher]), - returning = t_CompletableFuture[ts.OBJECT] - ) - } } } - parserTest("Capture with type annotation") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.lang.annotation.*; interface Iterator { Q next(); } @@ -461,26 +436,24 @@ class Foo { } """.trimIndent() + ) + + val (t_Iterator, _, t_Nullable) = acu.declaredTypeSignatures() + val rvar = acu.typeVar("R") + val tvar = acu.typeVar("T") + + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "apply", + withFormals = listOf(captureMatcher(`?` `super` tvar)), + returning = captureMatcher(`?` extends (`@`(t_Nullable.symbol) on t_Iterator[`?` extends rvar])) ) - - val (t_Iterator, _, t_Nullable) = acu.declaredTypeSignatures() - val rvar = acu.typeVar("R") - val tvar = acu.typeVar("T") - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "apply", - withFormals = listOf(captureMatcher(`?` `super` tvar)), - returning = captureMatcher(`?` extends (`@`(t_Nullable.symbol) on t_Iterator[`?` extends rvar])) - ) - acu.firstMethodCall().overloadSelectionInfo::isFailed shouldBe false - } + acu.firstMethodCall().overloadSelectionInfo::isFailed shouldBe false } } parserTest("PMD crashes while using generics and wildcards #4753") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( + val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.Collection; import java.util.List; @@ -494,23 +467,19 @@ public class SubClass { } } """.trimIndent() + ) + + val tvar = acu.typeVar("T") + + spy.shouldBeOk { + val call = acu.firstMethodCall() + + call.methodType.shouldMatchMethod( + named = "addAll", + withFormals = listOf(java.util.Collection::class[`?` extends captureMatcher(`?` `super` tvar)]), + returning = boolean ) - - val tvar = acu.typeVar("T") - - spy.shouldBeOk { - val call = acu.firstMethodCall() - - call.methodType.shouldMatchMethod( - named = "addAll", - withFormals = listOf(java.util.Collection::class[`?` extends captureMatcher(`?` `super` tvar)]), - returning = boolean - ) - call.overloadSelectionInfo::isFailed shouldBe false - } + call.overloadSelectionInfo::isFailed shouldBe false } } - }) - - diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt index e732f5febd..f19acf6b2b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/CtorInferenceTest.kt @@ -14,12 +14,9 @@ import net.sourceforge.pmd.lang.java.types.* * @author Clรฉment Fournier */ class CtorInferenceTest : ProcessorTestSpec({ - - parserTest("Results of diamond invoc and parameterized invoc are identical (normal classes)") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Gen { static { @@ -29,34 +26,31 @@ class CtorInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (paramCall, genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (paramCall, genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - with(acu.typeDsl) { + with(acu.typeDsl) { + listOf(paramCall, genCall).forAll { call -> - listOf(paramCall, genCall).forAll { call -> - - call.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Gen[gen.t_String], - withFormals = emptyList(), - returning = t_Gen[gen.t_String] - ).also { - it.typeParameters shouldBe emptyList() - it.isGeneric shouldBe false - } + call.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Gen[gen.t_String], + withFormals = emptyList(), + returning = t_Gen[gen.t_String] + ).also { + it.typeParameters shouldBe emptyList() + it.isGeneric shouldBe false } } } } parserTest("Enum constant ctors") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.function.Function; enum E { @@ -71,43 +65,39 @@ class CtorInferenceTest : ProcessorTestSpec({ E() {} } """ - ) + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (intCtor, doubleCtor, defaultCtor) = acu.descendants(ASTConstructorDeclaration::class.java) - .toList { it.symbol } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (intCtor, doubleCtor, defaultCtor) = acu.descendants(ASTConstructorDeclaration::class.java) + .toList { it.symbol } - val (a, b, c, d) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a, b, c, d) = acu.descendants(ASTEnumConstant::class.java).toList() - with(acu.typeDsl) { - - listOf(a, b).forAll { - it.methodType.symbol shouldBe defaultCtor - } - - c.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_E, - withFormals = listOf(int), - returning = t_E - ).also { it.symbol shouldBe intCtor } - - d.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_E, - withFormals = listOf(double), - returning = t_E - ).also { it.symbol shouldBe doubleCtor } + with(acu.typeDsl) { + listOf(a, b).forAll { + it.methodType.symbol shouldBe defaultCtor } + + c.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_E, + withFormals = listOf(int), + returning = t_E + ).also { it.symbol shouldBe intCtor } + + d.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_E, + withFormals = listOf(double), + returning = t_E + ).also { it.symbol shouldBe doubleCtor } } } - parserTest("Generic enum constant ctors") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.Function; enum E { @@ -119,57 +109,54 @@ class CtorInferenceTest : ProcessorTestSpec({ E(T c, Function fun) {} } """ - ) + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (_, _, genericCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, genericCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList { it.symbol } - val (a) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a) = acu.descendants(ASTEnumConstant::class.java).toList() - spy.shouldBeOk { + spy.shouldBeOk { - a.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_E, - withFormals = listOf( - double.box(), - gen.t_Function[`?` `super` double.box(), `?` extends double.box()] - ), - returning = t_E - ).also { it.symbol shouldBe genericCtor } - } + a.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_E, + withFormals = listOf( + double.box(), + gen.t_Function[`?` `super` double.box(), `?` extends double.box()] + ), + returning = t_E + ).also { it.symbol shouldBe genericCtor } } } parserTest("Anonymous enum ctor") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.function.Function; enum E { A { } } """ - ) + ) - val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_E) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (a) = acu.descendants(ASTEnumConstant::class.java).toList() + val (a) = acu.descendants(ASTEnumConstant::class.java).toList() - a.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_E, - withFormals = emptyList(), - returning = t_E // not the anonymous type - ) - } + a.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_E, + withFormals = emptyList(), + returning = t_E // not the anonymous type + ) } + parserTest("Generic superclass ctor") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Sup { public Sup(T referent, String cleaner) { } @@ -182,32 +169,30 @@ class CtorInferenceTest : ProcessorTestSpec({ } """ - ) + ) - val (t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (supCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + val (supCtor) = acu.descendants(ASTConstructorDeclaration::class.java).toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - with(ctor.typeDsl) { - ctor.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Sup[ts.STRING], - withFormals = listOf(ts.STRING, ts.STRING), - returning = t_Sup[ts.STRING] // the superclass type - ).also { - it.symbol shouldBe supCtor.symbol - it.symbol.tryGetNode() shouldBe supCtor - } + with(ctor.typeDsl) { + ctor.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Sup[ts.STRING], + withFormals = listOf(ts.STRING, ts.STRING), + returning = t_Sup[ts.STRING] // the superclass type + ).also { + it.symbol shouldBe supCtor.symbol + it.symbol.tryGetNode() shouldBe supCtor } } } parserTest("Qualified superclass ctor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Outer { @@ -225,33 +210,31 @@ class CtorInferenceTest : ProcessorTestSpec({ } """ + ) + + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() + + val (innerCtor) = acu.ctorDeclarations().toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + + spy.shouldBeOk { + ctor.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Outer select t_Inner[ts.STRING], + withFormals = listOf(ts.STRING), + returning = t_Outer select t_Inner[ts.STRING] ) - val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() - - val (innerCtor) = acu.ctorDeclarations().toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - - spy.shouldBeOk { - ctor.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Outer select t_Inner[ts.STRING], - withFormals = listOf(ts.STRING), - returning = t_Outer select t_Inner[ts.STRING] - ) - - ctor.methodType.let { - it.symbol shouldBe innerCtor.symbol - it.symbol.tryGetNode() shouldBe innerCtor - } + ctor.methodType.let { + it.symbol shouldBe innerCtor.symbol + it.symbol.tryGetNode() shouldBe innerCtor } } } parserTest("Qualified generic superclass ctor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Outer { @@ -271,62 +254,58 @@ class CtorInferenceTest : ProcessorTestSpec({ } """ + ) + + + val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() + + val (innerCtor) = acu.ctorDeclarations().toList() + val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() + + spy.shouldBeOk { + ctor.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = t_Outer[ts.INT.box()] select t_Inner, + withFormals = listOf(ts.INT.box()), + returning = t_Outer[ts.INT.box()] select t_Inner ) - - val (t_Outer, t_Inner, _) = acu.declaredTypeSignatures() - - val (innerCtor) = acu.ctorDeclarations().toList() - val (ctor) = acu.descendants(ASTExplicitConstructorInvocation::class.java).toList() - - spy.shouldBeOk { - ctor.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = t_Outer[ts.INT.box()] select t_Inner, - withFormals = listOf(ts.INT.box()), - returning = t_Outer[ts.INT.box()] select t_Inner - ) - - ctor.methodType.let { - it.symbol shouldBe innerCtor.symbol - it.symbol.tryGetNode() shouldBe innerCtor - } + ctor.methodType.let { + it.symbol shouldBe innerCtor.symbol + it.symbol.tryGetNode() shouldBe innerCtor } } } parserTest("Unresolved enclosing type for inner class ctor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch {{ someUnresolvedQualifier().new Inner(); }} """ - ) + ) - val (ctor) = acu.ctorCalls().toList() + val (ctor) = acu.ctorCalls().toList() - spy.shouldBeOk { - ctor.qualifier!!.shouldHaveType(ts.UNKNOWN) - ctor.typeNode.simpleName shouldBe "Inner" - ctor.typeNode.typeMirror.shouldBeSameInstanceAs(ctor.typeMirror) - ctor.typeNode shouldHaveType ts.UNKNOWN - // if we ever switch to creating a fake symbol - // .typeMirror.shouldBeA { - // it.symbol.isUnresolved shouldBe true - // it.symbol.simpleName shouldBe "Inner" - // } + spy.shouldBeOk { + ctor.qualifier!!.shouldHaveType(ts.UNKNOWN) + ctor.typeNode.simpleName shouldBe "Inner" + ctor.typeNode.typeMirror.shouldBeSameInstanceAs(ctor.typeMirror) + ctor.typeNode shouldHaveType ts.UNKNOWN + // if we ever switch to creating a fake symbol + // .typeMirror.shouldBeA { + // it.symbol.isUnresolved shouldBe true + // it.symbol.simpleName shouldBe "Inner" + // } - ctor.methodType.shouldBe(ts.UNRESOLVED_METHOD) - } + ctor.methodType.shouldBe(ts.UNRESOLVED_METHOD) } } parserTest("Failed overload resolution of context doesn't let types dangle") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ public class Generic { static class Inner {} @@ -336,25 +315,23 @@ class CtorInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (_, inner) = acu.declaredTypeSignatures() - val enclosingMethodCall = acu.firstMethodCall() - val ctorCall = acu.firstCtorCall() - val ctorSymbol = inner.constructors.first().symbol + val (_, inner) = acu.declaredTypeSignatures() + val enclosingMethodCall = acu.firstMethodCall() + val ctorCall = acu.firstCtorCall() + val ctorSymbol = inner.constructors.first().symbol - spy.shouldHaveMissingCtDecl(enclosingMethodCall) + spy.shouldHaveMissingCtDecl(enclosingMethodCall) - ctorCall.withTypeDsl { // for the enclosing method call - ctorCall.methodType.symbol shouldBe ctorSymbol - } + ctorCall.withTypeDsl { // for the enclosing method call + ctorCall.methodType.symbol shouldBe ctorSymbol } } parserTest("Mapping of type params doesn't fail") { - doTest { - val (acu, _) = parser.parseWithTypeInferenceSpy( - """ + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(Class c, E inst) {} @@ -366,16 +343,14 @@ class CtorInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.declaredTypeSignatures() - val ctorCall = acu.firstCtorCall() - val ctorSymbol = t_Gen.constructors.first().symbol + val (t_Gen) = acu.declaredTypeSignatures() + val ctorCall = acu.firstCtorCall() + val ctorSymbol = t_Gen.constructors.first().symbol - ctorCall.withTypeDsl { // for the enclosing method call - ctorCall.methodType.symbol shouldBe ctorSymbol - } + ctorCall.withTypeDsl { // for the enclosing method call + ctorCall.methodType.symbol shouldBe ctorSymbol } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt index eb341d4249..685407b377 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ExplicitTypesTest.kt @@ -17,11 +17,9 @@ class ExplicitTypesTest : ProcessorTestSpec({ // todo test explicit type args on ctor call - parserTest("Test explicit type arguments") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collection; @@ -33,32 +31,28 @@ class ExplicitTypesTest : ProcessorTestSpec({ void foreach(Collection action) {} } - """.trimIndent() - ) + """.trimIndent() + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType ts.NO_TYPE - call.arguments[0].shouldBeA { - it.methodType.shouldMatchMethod( - named = "emptyList", - declaredIn = Collections::class.decl, - withFormals = emptyList(), - returning = gen.`t_List{String}` - ) - } + spy.shouldBeOk { + call shouldHaveType ts.NO_TYPE + call.arguments[0].shouldBeA { + it.methodType.shouldMatchMethod( + named = "emptyList", + declaredIn = Collections::class.decl, + withFormals = emptyList(), + returning = gen.`t_List{String}` + ) } } } - - parserTest("Explicitly typed lambda") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Function { V apply(U u); @@ -76,25 +70,21 @@ class NodeStream { } """ - ) + ) - val (t_Function, _, _, t_Foo) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val call = acu.firstMethodCall() + val (t_Function, _, _, t_Foo) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val call = acu.firstMethodCall() - spy.shouldBeOk { - lambda shouldHaveType t_Function[t_Foo, t_Foo] - call.overloadSelectionInfo.isFailed shouldBe false - } + spy.shouldBeOk { + lambda shouldHaveType t_Function[t_Foo, t_Foo] + call.overloadSelectionInfo.isFailed shouldBe false } } - - parserTest("Explicitly typed lambda with wildcard") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Number {} interface Integer extends Number {} @@ -108,16 +98,13 @@ class NodeStream { } """ - ) + ) - val (t_Number, _, t_Predicate) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (t_Number, _, t_Predicate) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - spy.shouldBeOk { - lambda shouldHaveType t_Predicate[t_Number] - } + spy.shouldBeOk { + lambda shouldHaveType t_Predicate[t_Number] } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt index 9284aa4221..e61e9bbfc6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/Java7InferenceTest.kt @@ -13,12 +13,9 @@ import net.sourceforge.pmd.lang.java.types.* * @author Clรฉment Fournier */ class Java7InferenceTest : ProcessorTestSpec({ - - parserTest("Java 7 uses return constraints only if args are not enough", javaVersion = J1_7) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(T t) {} static { @@ -27,22 +24,20 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - // inferred to Gen> on java 7 - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[gen.t_String]]) - } + spy.shouldBeOk { + // inferred to Gen> on java 7 + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[gen.t_String]]) } } parserTest("Same test in java 8", javaVersion = J1_8) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { Gen(T t) {} static { @@ -51,23 +46,20 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) - } + spy.shouldBeOk { + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) } } - parserTest("Java 7 uses return constraints if needed", javaVersion = J1_7) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen { static { // inferred to Gen> @@ -75,23 +67,20 @@ class Java7InferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() + val (genCall) = acu.descendants(ASTConstructorCall::class.java).toList() - spy.shouldBeOk { - ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) - } + spy.shouldBeOk { + ctorInfersTo(genCall, inferredType = t_Gen[Class::class[`?`]]) } } - parserTest("Java 7 doesn't let context flow through ternary", javaVersion = J1_7) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { public void test() { final Sup l2; @@ -102,29 +91,27 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (conditional) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (conditional) = acu.descendants(ASTConditionalExpression::class.java).toList() - spy.shouldBeOk { - // no context + spy.shouldBeOk { + // no context - conditional.thenBranch.conversionContext::isMissing shouldBe true - conditional.thenBranch shouldHaveType t_Gen[ts.OBJECT] - conditional.elseBranch shouldHaveType t_Gen[ts.OBJECT] + conditional.thenBranch.conversionContext::isMissing shouldBe true + conditional.thenBranch shouldHaveType t_Gen[ts.OBJECT] + conditional.elseBranch shouldHaveType t_Gen[ts.OBJECT] - // and Gen on java 8 - conditional shouldHaveType t_Gen[ts.OBJECT] - } + // and Gen on java 8 + conditional shouldHaveType t_Gen[ts.OBJECT] } } parserTest("Java 7 doesn't use invocation context", javaVersion = J1_7) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { Gen(T t) {} Gen() {} @@ -138,31 +125,30 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() - val (genM1, genM2, genM3) = acu.methodCalls().toList() + val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() + val (genM1, genM2, genM3) = acu.methodCalls().toList() - spy.shouldBeOk { - // no context + spy.shouldBeOk { + // no context - ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) - ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) - ctorInfersTo(genString, t_Gen[ts.STRING]) + ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) + ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) + ctorInfersTo(genString, t_Gen[ts.STRING]) - methodInfersTo(genM1, t_Sup[ts.OBJECT]) - methodInfersTo(genM2, t_Sup[ts.STRING]) - methodInfersTo(genM3, t_Sup[ts.STRING]) - } + methodInfersTo(genM1, t_Sup[ts.OBJECT]) + methodInfersTo(genM2, t_Sup[ts.STRING]) + methodInfersTo(genM3, t_Sup[ts.STRING]) } } + parserTest("Java 7 doesn't use invocation context (2)", javaVersion = J1_7) { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Gen extends Sup { Gen(T t) {} Gen() {} @@ -176,27 +162,24 @@ class Java7InferenceTest : ProcessorTestSpec({ } class Sup {} """ - ) - val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + ) + val (t_Gen, t_Sup) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() - val (genM1, genM2, genM3) = acu.methodCalls().toList() + val (genDiamond, genDiamondString, genString) = acu.ctorCalls().toList() + val (genM1, genM2, genM3) = acu.methodCalls().toList() - spy.shouldBeOk { - // tests methods before ctors - methodInfersTo(genM1, t_Sup[ts.OBJECT]) - methodInfersTo(genM2, t_Sup[ts.STRING]) - methodInfersTo(genM3, t_Sup[ts.STRING]) + spy.shouldBeOk { + // tests methods before ctors + methodInfersTo(genM1, t_Sup[ts.OBJECT]) + methodInfersTo(genM2, t_Sup[ts.STRING]) + methodInfersTo(genM3, t_Sup[ts.STRING]) - ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) - ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) - ctorInfersTo(genString, t_Gen[ts.STRING]) - } + ctorInfersTo(genDiamond, t_Gen[ts.OBJECT]) + ctorInfersTo(genDiamondString, t_Gen[ts.STRING]) + ctorInfersTo(genString, t_Gen[ts.STRING]) } } - - }) private fun ctorInfersTo( diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt index 449873076a..7ed8dff383 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt @@ -23,8 +23,7 @@ import kotlin.test.assertEquals @Suppress("UNUSED_VARIABLE") class LambdaInferenceTest : ProcessorTestSpec({ - - parserTest("Test dangling method parameter - ok") { + parserTestContainer("Test dangling method parameter - ok") { importedTypes += java.util.List::class.java importedTypes += TypeInferenceTestCases::class.java genClassHeader = "class TypeInferenceTestCases" @@ -80,8 +79,7 @@ class LambdaInferenceTest : ProcessorTestSpec({ } } - parserTest("Test dangling method parameter recovery") { - + parserTestContainer("Test dangling method parameter recovery") { importedTypes += java.util.List::class.java importedTypes += TypeInferenceTestCases::class.java genClassHeader = "class TypeInferenceTestCases" @@ -98,7 +96,6 @@ class LambdaInferenceTest : ProcessorTestSpec({ """ - inContext(ExpressionParsingCtx) { chain should parseAs { methodCall("collect") { @@ -140,9 +137,8 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Test functional interface induced by intersection") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.Serializable; import java.util.function.Function; @@ -158,49 +154,46 @@ class LambdaInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() - fCall.shouldMatchN { - methodCall("f") { - it.methodType.symbol shouldBe f.symbol + fCall.shouldMatchN { + methodCall("f") { + it.methodType.symbol shouldBe f.symbol - with(it.typeDsl) { - // Function & java.io.Serializable - val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE + with(it.typeDsl) { + // Function & java.io.Serializable + val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE - it.methodType.shouldMatchMethod( - named = "f", - declaredIn = t_Scratch, - withFormals = listOf(serialFun), - returning = serialFun - ) - } + it.methodType.shouldMatchMethod( + named = "f", + declaredIn = t_Scratch, + withFormals = listOf(serialFun), + returning = serialFun + ) + } - argList { - exprLambda { - lambdaFormals(1) - methodCall("length") { - variableAccess("s") { - it shouldHaveType it.typeSystem.STRING - } - argList(0) + argList { + exprLambda { + lambdaFormals(1) + methodCall("length") { + variableAccess("s") { + it shouldHaveType it.typeSystem.STRING } + argList(0) } } } } } - } parserTest("Test functional interface induced by intersection 2") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.Serializable; import java.util.function.Function; @@ -217,37 +210,36 @@ class LambdaInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (f) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fCall) = acu.descendants(ASTMethodCall::class.java).toList() - fCall.shouldMatchN { - methodCall("f") { - it.methodType.symbol shouldBe f.symbol + fCall.shouldMatchN { + methodCall("f") { + it.methodType.symbol shouldBe f.symbol - with(it.typeDsl) { - // Function & java.io.Serializable - val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE + with(it.typeDsl) { + // Function & java.io.Serializable + val serialFun = gen.t_Function[gen.t_String, int.box()] * ts.SERIALIZABLE - it.methodType.shouldMatchMethod( - named = "f", - declaredIn = t_Scratch, - withFormals = listOf(serialFun), - returning = serialFun - ) - } + it.methodType.shouldMatchMethod( + named = "f", + declaredIn = t_Scratch, + withFormals = listOf(serialFun), + returning = serialFun + ) + } - argList { - exprLambda { - lambdaFormals(1) - methodCall("length") { - variableAccess("s") { - it shouldHaveType it.typeSystem.STRING - } - argList(0) + argList { + exprLambda { + lambdaFormals(1) + methodCall("length") { + variableAccess("s") { + it shouldHaveType it.typeSystem.STRING } + argList(0) } } } @@ -256,9 +248,8 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Test lambda with field access in return expression (inner ctor call)") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.function.Function; class Scratch { @@ -278,42 +269,40 @@ class LambdaInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() - fooCall.shouldMatchN { - methodCall("foo") { - argList { - exprLambda { - lambdaFormals(1) + fooCall.shouldMatchN { + methodCall("foo") { + argList { + exprLambda { + lambdaFormals(1) - fieldAccess("i") { - it shouldHaveType it.typeSystem.INT - constructorCall { - variableAccess("s") { - it shouldHaveType t_Scratch - } - classType("WithField") { - it shouldHaveType t_WithField - } - argList(0) + fieldAccess("i") { + it shouldHaveType it.typeSystem.INT + constructorCall { + variableAccess("s") { + it shouldHaveType t_Scratch } + classType("WithField") { + it shouldHaveType t_WithField + } + argList(0) } } } - it.methodType.symbol shouldBe foo.symbol // ask after asking for type of inner } + it.methodType.symbol shouldBe foo.symbol // ask after asking for type of inner } } } parserTest("Test lambda with field access in return expression (method call)") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.function.Function; class Scratch { @@ -335,27 +324,26 @@ class LambdaInferenceTest : ProcessorTestSpec({ } } """ - ) + ) - val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (fetch, foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() + val (t_Scratch, t_WithField) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (fetch, foo) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooCall) = acu.descendants(ASTMethodCall::class.java).toList() - fooCall.shouldMatchN { - methodCall("foo") { - it.methodType.symbol shouldBe foo.symbol - argList { - exprLambda { - lambdaFormals(1) + fooCall.shouldMatchN { + methodCall("foo") { + it.methodType.symbol shouldBe foo.symbol + argList { + exprLambda { + lambdaFormals(1) - fieldAccess("i") { - it shouldHaveType it.typeSystem.INT - methodCall("fetch") { - variableAccess("s") { - it shouldHaveType t_Scratch - } - argList(0) + fieldAccess("i") { + it shouldHaveType it.typeSystem.INT + methodCall("fetch") { + variableAccess("s") { + it shouldHaveType t_Scratch } + argList(0) } } } @@ -365,9 +353,8 @@ class LambdaInferenceTest : ProcessorTestSpec({ } parserTest("Method invocation selection in lambda return") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { interface Foo { @@ -388,32 +375,31 @@ class Scratch { } """.trimIndent() - ) + ) - val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ctx") { + call.shouldMatchN { + methodCall("ctx") { - argList { - exprLambda { - lambdaFormals(1) - methodCall("fetch") { - variableAccess("g") + argList { + exprLambda { + lambdaFormals(1) + methodCall("fetch") { + variableAccess("g") - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = "fetch", - declaredIn = t_G[gen.t_String], - withFormals = emptyList(), - returning = gen.t_String - ) - } - - argList(0) + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "fetch", + declaredIn = t_G[gen.t_String], + withFormals = emptyList(), + returning = gen.t_String + ) } + + argList(0) } } } @@ -421,11 +407,9 @@ class Scratch { } } - parserTest("Block lambda") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { interface Foo { @@ -446,34 +430,33 @@ class Scratch { } """.trimIndent() - ) + ) - val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (_, _, t_G) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ctx") { + call.shouldMatchN { + methodCall("ctx") { - argList { - blockLambda { - lambdaFormals(1) - block { - returnStatement { - methodCall("fetch") { - variableAccess("g") + argList { + blockLambda { + lambdaFormals(1) + block { + returnStatement { + methodCall("fetch") { + variableAccess("g") - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = "fetch", - declaredIn = t_G[gen.t_String], - withFormals = emptyList(), - returning = gen.t_String - ) - } - - argList(0) + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "fetch", + declaredIn = t_G[gen.t_String], + withFormals = emptyList(), + returning = gen.t_String + ) } + + argList(0) } } } @@ -483,11 +466,9 @@ class Scratch { } } - parserTest("Value compatibility unit tests") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { static { @@ -502,77 +483,68 @@ class Scratch { } """.trimIndent() - ) + ) - val infer = Infer(testTypeSystem, 8, TypeInferenceLogger.noop()) - val mirrors = JavaExprMirrors.forTypeResolution(infer) - val (a, b, c, d, e, f, h) = acu.descendants(ASTLambdaExpression::class.java) - .toList { mirrors.getTopLevelFunctionalMirror(it) as ExprMirror.LambdaExprMirror } + val infer = Infer(testTypeSystem, 8, TypeInferenceLogger.noop()) + val mirrors = JavaExprMirrors.forTypeResolution(infer) + val (a, b, c, d, e, f, h) = acu.descendants(ASTLambdaExpression::class.java) + .toList { mirrors.getTopLevelFunctionalMirror(it) as ExprMirror.LambdaExprMirror } - fun ExprMirror.LambdaExprMirror.shouldBeCompat(void: Boolean = false, value: Boolean = false) { - withClue(this) { - assertEquals(void, this.isVoidCompatible, "void compatible") - assertEquals(value, this.isValueCompatible, "value compatible") - } + fun ExprMirror.LambdaExprMirror.shouldBeCompat(void: Boolean = false, value: Boolean = false) { + withClue(this) { + assertEquals(void, this.isVoidCompatible, "void compatible") + assertEquals(value, this.isValueCompatible, "value compatible") } - - - a.shouldBeCompat(value = true) - b.shouldBeCompat(void = true) - c.shouldBeCompat(void = true) - d.shouldBeCompat(value = true) - e.shouldBeCompat(value = true, void = true) - f.shouldBeCompat(value = true, void = true) - h.shouldBeCompat(value = true, void = true) } + + + a.shouldBeCompat(value = true) + b.shouldBeCompat(void = true) + c.shouldBeCompat(void = true) + d.shouldBeCompat(value = true) + e.shouldBeCompat(value = true, void = true) + f.shouldBeCompat(value = true, void = true) + h.shouldBeCompat(value = true, void = true) } - - parserTest("Test void compatible lambda with value compatible body") { - doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ final Runnable pr = 0 == null ? null : () -> id(true); }} - """.trimIndent() - ) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType java.lang.Runnable::class.raw - } + spy.shouldBeOk { + lambda shouldHaveType java.lang.Runnable::class.raw } } parserTest("Test void compatible lambda with void body") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.DoubleConsumer; class Foo { protected DoubleConsumer emptyConsumer() { return e -> {}; } } - """.trimIndent() - ) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType DoubleConsumer::class.raw - } + spy.shouldBeOk { + lambda shouldHaveType DoubleConsumer::class.raw } } parserTest("Test early solved functional interface") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.DoubleConsumer; import java.util.List; class Foo { @@ -584,24 +556,22 @@ class Scratch { ok(singletonList(d -> { })); } } - """.trimIndent() - ) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType DoubleConsumer::class.raw - } + spy.shouldBeOk { + lambda shouldHaveType DoubleConsumer::class.raw } } parserTest("Test explicitly typed lambda with zero params, ground-target type inference") { - doTest { - // note that this is not actually implemented, we just special-case the case "zero parameters" - // this is todo for future, doesn't appear too useful + // note that this is not actually implemented, we just special-case the case "zero parameters" + // this is todo for future, doesn't appear too useful - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.function.Supplier; class Foo { @@ -610,21 +580,19 @@ class Scratch { public static final Foo FILENAME = Foo.withInitial(() -> "/*unknown*/"); } - """.trimIndent() - ) + """.trimIndent() + ) - val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() + val lambda = acu.descendants(ASTLambdaExpression::class.java).firstOrThrow() - spy.shouldBeOk { - lambda shouldHaveType Supplier::class[gen.t_String] - } + spy.shouldBeOk { + lambda shouldHaveType Supplier::class[gen.t_String] } } parserTest("Nested lambda param resolution (in to out)") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Foreachable { @@ -641,24 +609,22 @@ class Scratch { } """ - ) + ) - val (t_Foreachable, t_Action) = acu.declaredTypeSignatures() - val (action, f1, f2) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - val evar = acu.typeVar("E") + val (t_Foreachable, t_Action) = acu.declaredTypeSignatures() + val (action, f1, f2) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() + val evar = acu.typeVar("E") - spy.shouldBeOk { - f2 shouldHaveType evar - f1 shouldHaveType t_Foreachable[evar] - action shouldHaveType t_Action[`?` `super` evar] - } + spy.shouldBeOk { + f2 shouldHaveType evar + f1 shouldHaveType t_Foreachable[evar] + action shouldHaveType t_Action[`?` `super` evar] } } parserTest("Nested lambda param resolution, when there are several overloads to give ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Runnable { void run(); } interface Supplier { E get(); } @@ -675,24 +641,22 @@ class Scratch { } } """ - ) + ) - val (t_Runnable, t_Supplier, t_Action, t_Foreachable) = acu.declaredTypeSignatures() - val (run, action) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (s) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() + val (t_Runnable, t_Supplier, t_Action, t_Foreachable) = acu.declaredTypeSignatures() + val (run, action) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (s) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - spy.shouldBeOk { - run shouldHaveType t_Runnable - action shouldHaveType t_Action[gen.t_String] - s shouldHaveType gen.t_String - } + spy.shouldBeOk { + run shouldHaveType t_Runnable + action shouldHaveType t_Action[gen.t_String] + s shouldHaveType gen.t_String } } parserTest("Body expression should be ground") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Iterator {} interface Function { @@ -711,34 +675,31 @@ class NodeStream { } """ - ) + ) - val (t_Iterator, t_Function, t_NodeStream) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (iter) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() - val (_, _, _, tvar, rvar) = acu.typeVariables() + val (t_Iterator, t_Function, t_NodeStream) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (iter) = acu.descendants(ASTLambdaParameter::class.java).crossFindBoundaries().toList() + val (_, _, _, tvar, rvar) = acu.typeVariables() - spy.shouldBeOk { - lambda shouldHaveType t_Function[t_Iterator[tvar], t_Iterator[rvar]] - iter shouldHaveType t_Iterator[tvar] - lambda.expressionBody!!.shouldBeA { - it.methodType.shouldMatchMethod( - named = "mapNotNull", - withFormals = listOf( - t_Iterator[`?` extends tvar], - t_Function[`?` `super` tvar, `?` extends rvar] - ) + spy.shouldBeOk { + lambda shouldHaveType t_Function[t_Iterator[tvar], t_Iterator[rvar]] + iter shouldHaveType t_Iterator[tvar] + lambda.expressionBody!!.shouldBeA { + it.methodType.shouldMatchMethod( + named = "mapNotNull", + withFormals = listOf( + t_Iterator[`?` extends tvar], + t_Function[`?` `super` tvar, `?` extends rvar] ) - it shouldHaveType t_Iterator[rvar] - } + ) + it shouldHaveType t_Iterator[rvar] } } } - parserTest("Lambda bug with nested lambdas") { - + parserTestContainer("Lambda bug with nested lambdas") { fun makeTest(insideOut: Boolean) { - val (acu, spy) = parser.parseWithTypeInferenceSpy( """ interface Function { @@ -758,7 +719,6 @@ class NodeStream { val (lambdaX, lambdaY) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries() .toList() - spy.shouldBeOk { val t_lambdaY = t_Function[t_Scratch, ts.STRING] val t_lambdaX = t_Function[ts.OBJECT, t_lambdaY] @@ -773,7 +733,6 @@ class NodeStream { } } - doTest("Outside in") { makeTest(false) } @@ -783,11 +742,9 @@ class NodeStream { } } - parserTest("inference of call within lambda fails") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Iterator {} interface Function { @@ -805,24 +762,21 @@ class NodeStream { } """ - ) + ) - val (t_Iterator, t_Function, t_Iterable) = acu.declaredTypeSignatures() - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() - val (_, _, _, _, tvar, rvar) = acu.typeVariables() + val (t_Iterator, t_Function, t_Iterable) = acu.declaredTypeSignatures() + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).crossFindBoundaries().toList() + val (_, _, _, _, tvar, rvar) = acu.typeVariables() - spy.shouldBeOk { - lambda shouldHaveType t_Iterable[rvar] - lambda.expressionBody!!.shouldBeA { - it.methodType.shouldMatchMethod( - named = "apply", - withFormals = listOf(captureMatcher(`?` `super` t_Iterator[`?` extends tvar])) - ) - it.overloadSelectionInfo::isFailed shouldBe false - } + spy.shouldBeOk { + lambda shouldHaveType t_Iterable[rvar] + lambda.expressionBody!!.shouldBeA { + it.methodType.shouldMatchMethod( + named = "apply", + withFormals = listOf(captureMatcher(`?` `super` t_Iterator[`?` extends tvar])) + ) + it.overloadSelectionInfo::isFailed shouldBe false } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt index 87fb71ae61..268b973d29 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LocalVarInferenceTest.kt @@ -13,63 +13,56 @@ import net.sourceforge.pmd.lang.java.types.* * */ class LocalVarInferenceTest : ProcessorTestSpec({ - parserTest("Test for var inference projection") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static void take5(Iterable iter) { for (var entry : iter) { } // entry is projected to `T`, not `? extends T` } } - """.trimIndent() - ) + """.trimIndent() + ) - val tvar = acu.typeVariables()[0] - val entryId = acu.varId("entry") - val iterAccess = acu.varAccesses("iter")[0]!! + val tvar = acu.typeVariables()[0] + val entryId = acu.varId("entry") + val iterAccess = acu.varAccesses("iter")[0]!! - spy.shouldBeOk { - entryId shouldHaveType tvar // not ? extends T - iterAccess shouldHaveType gen.t_Iterable[captureMatcher(`?` extends tvar)] - } + spy.shouldBeOk { + entryId shouldHaveType tvar // not ? extends T + iterAccess shouldHaveType gen.t_Iterable[captureMatcher(`?` extends tvar)] } } parserTest("Test local var inference") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ var map = new java.util.HashMap(((4 * convCount) / 3) + 1); for (var entry : map.entrySet()) { int[] positions = entry.getValue(); } }} - """ - ) + """ + ) - val (entrySet, getValue) = acu.methodCalls().toList() + val (entrySet, getValue) = acu.methodCalls().toList() - spy.shouldBeOk { - val entryType = java.util.Map.Entry::class[ts.OBJECT, int.toArray()] - entrySet shouldHaveType java.util.Set::class[entryType] - getValue shouldHaveType int.toArray() - getValue.qualifier!!.shouldMatchN { - variableAccess("entry") { - it shouldHaveType entryType - - } + spy.shouldBeOk { + val entryType = java.util.Map.Entry::class[ts.OBJECT, int.toArray()] + entrySet shouldHaveType java.util.Set::class[entryType] + getValue shouldHaveType int.toArray() + getValue.qualifier!!.shouldMatchN { + variableAccess("entry") { + it shouldHaveType entryType } } } } parserTest("Unbounded wild is projected to upper bound of its underlying tvar") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch> { public S getS() {return null;} @@ -81,35 +74,31 @@ class Scratch> { var k = unbounded.getS(); } } - """.trimIndent() - ) + """.trimIndent() + ) - val t_Scratch = acu.firstTypeSignature() + val t_Scratch = acu.firstTypeSignature() - spy.shouldBeOk { - acu.varId("k") shouldHaveType t_Scratch[`?` extends t_Scratch[`?`]] - } + spy.shouldBeOk { + acu.varId("k") shouldHaveType t_Scratch[`?` extends t_Scratch[`?`]] } } parserTest("Local var for anonymous") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { static { var k = new Runnable() {}; } } - """.trimIndent() - ) + """.trimIndent() + ) - spy.shouldBeOk { - // not the anon type - acu.varId("k") shouldHaveType Runnable::class.decl - } + spy.shouldBeOk { + // not the anon type + acu.varId("k") shouldHaveType Runnable::class.decl } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt index eec91dbef5..e928dda72b 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/MethodRefInferenceTest.kt @@ -18,12 +18,9 @@ import java.util.function.Function as JavaFunction @Suppress("UNUSED_VARIABLE") class MethodRefInferenceTest : ProcessorTestSpec({ - - parserTest("Test inexact method ref of generic type") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Optional; import java.util.List; import java.util.stream.Stream; @@ -36,34 +33,27 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - """.trimIndent() - ) + """.trimIndent() + ) - val t_Archive = acu.descendants(ASTClassDeclaration::class.java).firstOrThrow().typeMirror - val anyMatch = acu.descendants(ASTMethodCall::class.java).first()!! + val t_Archive = acu.descendants(ASTClassDeclaration::class.java).firstOrThrow().typeMirror + val anyMatch = acu.descendants(ASTMethodCall::class.java).first()!! - anyMatch.shouldMatchN { - methodCall("anyMatch") { - it shouldHaveType it.typeSystem.BOOLEAN + anyMatch.shouldMatchN { + methodCall("anyMatch") { + it shouldHaveType it.typeSystem.BOOLEAN - methodCall("filter") { + methodCall("filter") { + it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } + methodCall("flatMap") { it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } - methodCall("flatMap") { - - it shouldHaveType with(it.typeDsl) { gen.t_Stream[t_Archive] } - - methodCall("of") { - skipQualifier() - - it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_List[t_Archive]] } - - argList(3) - } - - argList(1) + methodCall("of") { + skipQualifier() + it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_List[t_Archive]] } + argList(3) } argList(1) @@ -71,21 +61,18 @@ class MethodRefInferenceTest : ProcessorTestSpec({ argList(1) } + + argList(1) } } } - - - parserTest("Test call chain with method reference") { - + parserTestContainer("Test call chain with method reference") { otherImports += "java.util.stream.*" val chain = "Stream.of(\"\").map(String::isEmpty).collect(Collectors.toList())" inContext(ExpressionParsingCtx) { - - chain should parseAs { methodCall("collect") { it shouldHaveType with(it.typeDsl) { gen.t_List[boolean.box()] } @@ -131,14 +118,12 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - parserTest("Test call chain with constructor reference") { - + parserTestContainer("Test call chain with constructor reference") { otherImports += "java.util.stream.*" val chain = "Stream.of(1, 2).map(int[]::new).collect(Collectors.toList())" inContext(ExpressionParsingCtx) { - chain should parseAs { methodCall("collect") { @@ -189,14 +174,11 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - - parserTest("Test call chain with array method reference") { - + parserTestContainer("Test call chain with array method reference") { otherImports += "java.util.stream.*" val chain = "Stream.of(new int[0]).map(int[]::clone)" - inContext(ExpressionParsingCtx) { chain should parseAs { methodCall("map") { @@ -245,19 +227,14 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - parserTest("Test method reference overload resolution") { - + parserTestContainer("Test method reference overload resolution") { otherImports += "java.util.stream.*" val chain = "Stream.of(\"\", 4).reduce(new StringBuilder(), StringBuilder::append, StringBuilder::append)" inContext(ExpressionParsingCtx) { - - chain should parseAs { methodCall("reduce") { - - // we can't hardcode the lub because it is jdk specific val serialLub = with(it.typeDsl) { ts.lub(gen.t_String, gen.t_Integer) @@ -268,7 +245,6 @@ class MethodRefInferenceTest : ProcessorTestSpec({ val t_Sb = with(it.typeDsl) { gen.t_StringBuilder } with(it.typeDsl) { - it shouldHaveType t_Sb it.methodType.shouldMatchMethod( named = "reduce", @@ -314,7 +290,6 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } methodRef("append") { - with(it.typeDsl) { val myBifunction = t_BiFunction[t_Sb, t_Sb, t_Sb] @@ -335,13 +310,9 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - - parserTest("Test failing method ref with this as LHS") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package scratch; import java.util.Comparator; @@ -355,31 +326,28 @@ class MethodRefInferenceTest : ProcessorTestSpec({ } } - """.trimIndent() - ) + """.trimIndent() + ) - val t_Archive = acu.firstTypeSignature() - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - val call = acu.firstMethodCall() + val t_Archive = acu.firstTypeSignature() + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() + val call = acu.firstMethodCall() - spy.shouldHaveMissingCtDecl(call) + spy.shouldHaveMissingCtDecl(call) - acu.withTypeDsl { - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD - mref shouldHaveType ts.UNKNOWN - call.methodType shouldBe ts.UNRESOLVED_METHOD - call.overloadSelectionInfo.apply { - isFailed shouldBe true - } + acu.withTypeDsl { + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD + mref shouldHaveType ts.UNKNOWN + call.methodType shouldBe ts.UNRESOLVED_METHOD + call.overloadSelectionInfo.apply { + isFailed shouldBe true } } } parserTest("Test method ref with void return type") { - doTest { - - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Optional; class Archive { @@ -388,32 +356,31 @@ class MethodRefInferenceTest : ProcessorTestSpec({ return "foo"; } } - """.trimIndent() - ) + """.trimIndent() + ) - val t_Archive = acu.firstTypeSignature() - val getName = acu.methodDeclarations().firstOrThrow() - val ifPresentCall = acu.firstMethodCall() + val t_Archive = acu.firstTypeSignature() + val getName = acu.methodDeclarations().firstOrThrow() + val ifPresentCall = acu.firstMethodCall() - spy.shouldBeOk { - ifPresentCall.shouldMatchN { - methodCall("ifPresent") { - unspecifiedChild() - argList { - methodRef("getName") { - it.functionalMethod.shouldMatchMethod( - named = "accept", - declaredIn = Consumer::class[t_Archive], - withFormals = listOf(t_Archive), - returning = ts.NO_TYPE - ) + spy.shouldBeOk { + ifPresentCall.shouldMatchN { + methodCall("ifPresent") { + unspecifiedChild() + argList { + methodRef("getName") { + it.functionalMethod.shouldMatchMethod( + named = "accept", + declaredIn = Consumer::class[t_Archive], + withFormals = listOf(t_Archive), + returning = ts.NO_TYPE + ) - it.referencedMethod.symbol shouldBe getName.symbol + it.referencedMethod.symbol shouldBe getName.symbol - typeExpr { - classType("Archive") - } + typeExpr { + classType("Archive") } } } @@ -425,9 +392,8 @@ class MethodRefInferenceTest : ProcessorTestSpec({ // disabled for now parserTest("Test inference var inst substitution in enclosing ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Collections; import java.util.Iterator; import java.util.function.Function; @@ -448,39 +414,37 @@ abstract class NodeStream implements Iterable { protected abstract NodeStream mapIter(Function, Iterator> fun); } - """.trimIndent() - ) + """.trimIndent() + ) - val (t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (tvar, rvar, kvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val (t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (tvar, rvar, kvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.t_Function[captureMatcher(`?` `super` tvar), gen.t_Iterator[`?` extends rvar]] - call.arguments[0].shouldMatchN { - methodRef("safeMap") { - with(it.typeDsl) { - // safeMap#K must have been instantiated to some variation of R - it.referencedMethod.shouldMatchMethod( - named = "safeMap", - declaredIn = t_NodeStream.erasure, - withFormals = listOf(t_NodeStream[`?` extends rvar]), - returning = gen.t_Iterator[captureMatcher(`?` extends rvar)] - ) - } - - skipQualifier() + spy.shouldBeOk { + call shouldHaveType gen.t_Function[captureMatcher(`?` `super` tvar), gen.t_Iterator[`?` extends rvar]] + call.arguments[0].shouldMatchN { + methodRef("safeMap") { + with(it.typeDsl) { + // safeMap#K must have been instantiated to some variation of R + it.referencedMethod.shouldMatchMethod( + named = "safeMap", + declaredIn = t_NodeStream.erasure, + withFormals = listOf(t_NodeStream[`?` extends rvar]), + returning = gen.t_Iterator[captureMatcher(`?` extends rvar)] + ) } + + skipQualifier() } } } } parserTest("Fix method ref non-wildcard parameterization not being ground in listener") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import static java.util.stream.Collectors.collectingAndThen; import static java.util.stream.Collectors.toList; @@ -497,40 +461,39 @@ class Scratch { .collect(collectingAndThen(toList(), Collections::unmodifiableList)); } } - """.trimIndent() - ) + """.trimIndent() + ) - val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! + val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! - collectCall.shouldMatchN { - methodCall("collect") { + collectCall.shouldMatchN { + methodCall("collect") { + with(it.typeDsl) { + it shouldHaveType gen.`t_List{String}` + } + + methodCall("distinct") { with(it.typeDsl) { - it shouldHaveType gen.`t_List{String}` + it shouldHaveType gen.t_Stream[gen.t_String] } - methodCall("distinct") { + unspecifiedChildren(2) + } + + argList { + methodCall("collectingAndThen") { with(it.typeDsl) { - it shouldHaveType gen.t_Stream[gen.t_String] + it shouldHaveType Collector::class[gen.t_String, ts.OBJECT, gen.`t_List{String}`] } - unspecifiedChildren(2) - } - - argList { - methodCall("collectingAndThen") { - with(it.typeDsl) { - it shouldHaveType Collector::class[gen.t_String, ts.OBJECT, gen.`t_List{String}`] - } - - argList { - methodCall("toList") - methodRef("unmodifiableList") { - unspecifiedChild() - with(it.typeDsl) { - it shouldHaveType gen.t_Function[gen.`t_List{String}`, gen.`t_List{String}`] - it.functionalMethod shouldBe it.typeMirror.streamMethods { it.simpleName == "apply" } - .findFirst().get() - } + argList { + methodCall("toList") + methodRef("unmodifiableList") { + unspecifiedChild() + with(it.typeDsl) { + it shouldHaveType gen.t_Function[gen.`t_List{String}`, gen.`t_List{String}`] + it.functionalMethod shouldBe it.typeMirror.streamMethods { it.simpleName == "apply" } + .findFirst().get() } } } @@ -540,8 +503,7 @@ class Scratch { } } - parserTest("Method refs targeting a void function in unambiguous context must still be assigned a type") { - + parserTestContainer("Method refs targeting a void function in unambiguous context must still be assigned a type") { val acu = parser.parse(""" import java.util.function.IntConsumer; import java.util.function.LongConsumer; @@ -571,7 +533,6 @@ class Scratch { val (castRef, returnRef) = acu.descendants(ASTMethodReference::class.java).toList() doTest("In cast context") { - castRef.shouldMatchN { methodRef("accept") { unspecifiedChild() @@ -592,7 +553,6 @@ class Scratch { } doTest("In return context") { - returnRef.shouldMatchN { methodRef("accept") { unspecifiedChild() @@ -614,9 +574,8 @@ class Scratch { } parserTest("Method refs disambiguation between static methods") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.function.IntConsumer; class Scratch { @@ -637,48 +596,46 @@ class Scratch { ic = Scratch::baz; } } - """.trimIndent() - ) + """.trimIndent() + ) - val (fooRef, barRef, bazRef) = acu.descendants(ASTMethodReference::class.java).toList() + val (fooRef, barRef, bazRef) = acu.descendants(ASTMethodReference::class.java).toList() - val t_IntConsumer = with(acu.typeDsl) { IntConsumer::class.decl } + val t_IntConsumer = with(acu.typeDsl) { IntConsumer::class.decl } - fooRef.shouldMatchN { - methodRef("foo") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + fooRef.shouldMatchN { + methodRef("foo") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() - } + unspecifiedChild() } + } - barRef.shouldMatchN { - methodRef("bar") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + barRef.shouldMatchN { + methodRef("bar") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() - } + unspecifiedChild() } + } - bazRef.shouldMatchN { - methodRef("baz") { - it shouldHaveType t_IntConsumer - it.referencedMethod.arity shouldBe 1 + bazRef.shouldMatchN { + methodRef("baz") { + it shouldHaveType t_IntConsumer + it.referencedMethod.arity shouldBe 1 - unspecifiedChild() - } + unspecifiedChild() } } } parserTest("Test inexact method ref conflict between static and non-static for primitive type") { - doTest { - // this is related to the test below, but this works for inexact methods + // this is related to the test below, but this works for inexact methods - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.*; class Archive { @@ -690,33 +647,30 @@ class Scratch { .collect(Collectors.joining(", ")); } } - """.trimIndent() - ) + """.trimIndent() + ) - val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! + val collectCall = acu.descendants(ASTMethodCall::class.java).first()!! - spy.shouldBeOk { - collectCall.shouldMatchN { - methodCall("collect") { - it shouldHaveType gen.t_String + spy.shouldBeOk { + collectCall.shouldMatchN { + methodCall("collect") { + it shouldHaveType gen.t_String - methodCall("mapToObj") { - it shouldHaveType gen.t_Stream[gen.t_String] + methodCall("mapToObj") { + it shouldHaveType gen.t_Stream[gen.t_String] - unspecifiedChildren(2) - } - - argList(1) + unspecifiedChildren(2) } + + argList(1) } } } } - parserTest("Exact method ref with primitive receiver cannot select instance methods of wrapper type") { - doTest { val acu = parser.parse(""" import java.util.stream.IntStream; @@ -739,14 +693,11 @@ class Scratch { unspecifiedChildren(2) } } - } } - parserTest("Missing compile-time decl") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ interface IntConsumer { void accept(int i); } class Scratch { @@ -755,29 +706,25 @@ class Scratch { IntConsumer ic = Scratch::foo; } } - """.trimIndent() - ) + """.trimIndent() + ) - val (t_IntConsumer) = acu.declaredTypeSignatures() - val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() + val (t_IntConsumer) = acu.declaredTypeSignatures() + val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() - fooRef.shouldMatchN { - methodRef("foo") { - it shouldHaveType t_IntConsumer - it.referencedMethod shouldBe it.typeSystem.UNRESOLVED_METHOD + fooRef.shouldMatchN { + methodRef("foo") { + it shouldHaveType t_IntConsumer + it.referencedMethod shouldBe it.typeSystem.UNRESOLVED_METHOD - unspecifiedChild() - } + unspecifiedChild() } } } - - parserTest("Method ref inside poly conditional, conditional type is fetched first") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Objects; interface Predicate { @@ -789,29 +736,25 @@ interface Predicate { : object -> targetRef.equals(object); } } - """.trimIndent() - ) + """.trimIndent() + ) + val t_Predicate = acu.firstTypeSignature() + val testMethod = acu.methodDeclarations().get(0)!! + val tvar = acu.typeVar("T") + val (ternary) = acu.descendants(ASTConditionalExpression::class.java).toList() + val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() - val t_Predicate = acu.firstTypeSignature() - val testMethod = acu.methodDeclarations().get(0)!! - val tvar = acu.typeVar("T") - val (ternary) = acu.descendants(ASTConditionalExpression::class.java).toList() - val (fooRef) = acu.descendants(ASTMethodReference::class.java).toList() - - spy.shouldBeOk { - ternary shouldHaveType t_Predicate[tvar] - fooRef.functionalMethod.shouldBeSomeInstantiationOf(testMethod.genericSignature) - fooRef shouldHaveType t_Predicate[tvar] - } + spy.shouldBeOk { + ternary shouldHaveType t_Predicate[tvar] + fooRef.functionalMethod.shouldBeSomeInstantiationOf(testMethod.genericSignature) + fooRef shouldHaveType t_Predicate[tvar] } } - parserTest("Method ref on static class") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Arrays; import java.util.Objects; import java.util.stream.Stream; @@ -824,50 +767,46 @@ interface Predicate { } } - """.trimIndent() - ) + """.trimIndent() + ) - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("map") { + call.shouldMatchN { + methodCall("map") { + it shouldHaveType with(it.typeDsl) { + gen.t_Stream[gen.t_String] + } + + it::getQualifier shouldBe methodCall("stream") { it shouldHaveType with(it.typeDsl) { - gen.t_Stream[gen.t_String] + gen.t_Stream[ts.OBJECT] } - it::getQualifier shouldBe methodCall("stream") { - it shouldHaveType with(it.typeDsl) { - gen.t_Stream[ts.OBJECT] - } - - unspecifiedChildren(2) - } - - argList { - - methodRef("toString") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( - named = "toString", - declaredIn = java.util.Objects::class.raw, - withFormals = listOf(ts.OBJECT), - returning = ts.STRING - ) - } - unspecifiedChild() + unspecifiedChildren(2) + } + + argList { + + methodRef("toString") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( + named = "toString", + declaredIn = java.util.Objects::class.raw, + withFormals = listOf(ts.OBJECT), + returning = ts.STRING + ) } + unspecifiedChild() } } } } } - - parserTest("Method ref where target type is fully unknown (is an ivar)") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Map; import java.util.Map.Entry; import java.util.function.Function; @@ -891,57 +830,56 @@ interface Predicate { return args; } } - """.trimIndent() - ) + """.trimIndent() + ) - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("ofEntries") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = "ofEntries", - declaredIn = call.enclosingType.typeMirror, - withFormals = listOf(gen.t_MapEntry[`?` extends gen.t_String, `?` extends gen.t_Function[int.box(), int.box()]].toArray()), - returning = gen.t_Map[gen.t_String, gen.t_Function[int.box(), int.box()]] - ) - } + call.shouldMatchN { + methodCall("ofEntries") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "ofEntries", + declaredIn = call.enclosingType.typeMirror, + withFormals = listOf(gen.t_MapEntry[`?` extends gen.t_String, `?` extends gen.t_Function[int.box(), int.box()]].toArray()), + returning = gen.t_Map[gen.t_String, gen.t_Function[int.box(), int.box()]] + ) + } - argList { + argList { - methodCall("entry") { - argList { - unspecifiedChild() + methodCall("entry") { + argList { + unspecifiedChild() - methodRef("add") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( - named = "add", - declaredIn = call.enclosingType.typeMirror, - withFormals = listOf(int), - returning = int - ) - } - unspecifiedChild() + methodRef("add") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( + named = "add", + declaredIn = call.enclosingType.typeMirror, + withFormals = listOf(int), + returning = int + ) } + unspecifiedChild() } } + } - methodCall("entry") { - argList { - unspecifiedChild() + methodCall("entry") { + argList { + unspecifiedChild() - methodRef("add") { - with(it.typeDsl) { - it.referencedMethod.shouldMatchMethod( - named = "add", - declaredIn = call.enclosingType.typeMirror, - withFormals = listOf(int), - returning = int - ) - } - unspecifiedChild() + methodRef("add") { + with(it.typeDsl) { + it.referencedMethod.shouldMatchMethod( + named = "add", + declaredIn = call.enclosingType.typeMirror, + withFormals = listOf(int), + returning = int + ) } + unspecifiedChild() } } } @@ -950,11 +888,9 @@ interface Predicate { } } - parserTest("Method ref with explicit type parameters") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Optional; class Scratch { @@ -974,57 +910,52 @@ class Scratch { } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } - val (_, tvar) = acu.descendants(ASTTypeParameter::class.java).crossFindBoundaries().toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val (_, t_NodeStream) = acu.descendants(ASTClassDeclaration::class.java).toList { it.typeMirror } + val (_, tvar) = acu.descendants(ASTTypeParameter::class.java).crossFindBoundaries().toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("orElseGet") { + call.shouldMatchN { + methodCall("orElseGet") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "orElseGet", + declaredIn = Optional::class[t_NodeStream[tvar]], + withFormals = listOf(Supplier::class[`?` extends t_NodeStream[tvar]]), + returning = t_NodeStream[tvar] + ) + } + + methodCall("map") { with(it.typeDsl) { + val capture = captureMatcher(`?` extends tvar) it.methodType.shouldMatchMethod( - named = "orElseGet", - declaredIn = Optional::class[t_NodeStream[tvar]], - withFormals = listOf(Supplier::class[`?` extends t_NodeStream[tvar]]), - returning = t_NodeStream[tvar] + named = "map", + declaredIn = Optional::class[capture], + withFormals = listOf(JavaFunction::class[`?` `super` capture, `?` extends t_NodeStream[tvar]]), + returning = Optional::class[t_NodeStream[tvar]] ) } - methodCall("map") { - with(it.typeDsl) { - val capture = captureMatcher(`?` extends tvar) - it.methodType.shouldMatchMethod( - named = "map", - declaredIn = Optional::class[capture], - withFormals = listOf(JavaFunction::class[`?` `super` capture, `?` extends t_NodeStream[tvar]]), - returning = Optional::class[t_NodeStream[tvar]] - ) - } - - variableAccess("optNode") - - argList { - methodRef("singleton") - } - } + variableAccess("optNode") argList { - methodRef("empty") + methodRef("singleton") } } + + argList { + methodRef("empty") + } } } } - - parserTest("Test incompatibility with formal interface") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ package scratch; import static java.util.stream.Collectors.joining; @@ -1060,31 +991,26 @@ class Scratch { } } - """.trimIndent() + """.trimIndent() + ) + + val t_Archive = acu.firstTypeSignature() + + val mref = acu.descendants(ASTMethodReference::class.java)[1]!! + + spy.shouldBeOk { + mref.functionalMethod.shouldMatchMethod( + named = "apply", + declaredIn = gen.t_Function[gen.t_List[t_Archive], gen.t_String], + withFormals = listOf(gen.t_List[t_Archive]), + returning = gen.t_String ) - - val t_Archive = acu.firstTypeSignature() - - val mref = acu.descendants(ASTMethodReference::class.java)[1]!! - - spy.shouldBeOk { - mref.functionalMethod.shouldMatchMethod( - named = "apply", - declaredIn = gen.t_Function[gen.t_List[t_Archive], gen.t_String], - withFormals = listOf(gen.t_List[t_Archive]), - returning = gen.t_String - ) - } } } - - parserTest("Exact mref with this as lhs, referencing generic instance method, with type params mentioned in the return type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { private final MapMaker mapMaker = this::copyToMutable; @@ -1101,26 +1027,23 @@ class Scratch { Map copy(Map m); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (t_Scratch, t_Map, t_MapMaker) = acu.declaredTypeSignatures() - val (copyToMutable, copy) = acu.declaredMethodSignatures() + val (t_Scratch, t_Map, t_MapMaker) = acu.declaredTypeSignatures() + val (copyToMutable, copy) = acu.declaredMethodSignatures() - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - spy.shouldBeOk { - mref.functionalMethod shouldBe t_MapMaker[gen.t_String].getDeclaredMethod(copy.symbol) - mref.referencedMethod shouldBe copyToMutable // exactly, ie V was not substituted - } + spy.shouldBeOk { + mref.functionalMethod shouldBe t_MapMaker[gen.t_String].getDeclaredMethod(copy.symbol) + mref.referencedMethod shouldBe copyToMutable // exactly, ie V was not substituted } } - parserTest("Inexact mref which must differentiate two overridden overloads") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ // reproduces what's in java.util, to not depend on JDK version interface Collection { @@ -1155,24 +1078,19 @@ class Scratch { boolean plus(MySet m, Collection other); // 3 } } + """.trimIndent() + ) + val (_, _, abstractColl, _, _, _, t_Additioner) = acu.declaredTypeSignatures() + val (_, _, inAbstractColl, plus) = acu.declaredMethodSignatures() - """.trimIndent() - ) + val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - val (_, _, abstractColl, _, _, _, t_Additioner) = acu.declaredTypeSignatures() - val (_, _, inAbstractColl, plus) = acu.declaredMethodSignatures() - - val mref = acu.descendants(ASTMethodReference::class.java).firstOrThrow() - - spy.shouldBeOk { - mref.functionalMethod shouldBe plus - val rvar = plus.typeParameters[0]!! - mref.referencedMethod shouldBe abstractColl[rvar].getDeclaredMethod(inAbstractColl.symbol) - mref shouldHaveType t_Additioner - } + spy.shouldBeOk { + mref.functionalMethod shouldBe plus + val rvar = plus.typeParameters[0]!! + mref.referencedMethod shouldBe abstractColl[rvar].getDeclaredMethod(inAbstractColl.symbol) + mref shouldHaveType t_Additioner } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt index 86d737258c..f572502ed4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadResolutionTest.kt @@ -78,12 +78,10 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - parserTest("Test strict overload") { - + parserTestContainer("Test strict overload") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { - "of($t_SomeEnum_name.FOO)" should parseAs { methodCall("of") { with (it.typeDsl) { @@ -105,11 +103,10 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - parserTest("Test partially unresolved") { - + parserTestContainer("Test partially unresolved") { asIfIn(Overloads::class.java) - inContext(ExpressionParsingCtx) { + inContext(ExpressionParsingCtx) { "of(DoesntExist.FOO)" should parseAs { methodCall("of") { with (it.typeDsl) { @@ -132,8 +129,7 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - parserTest("Test strict overload 2 args") { - + parserTestContainer("Test strict overload 2 args") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { @@ -158,8 +154,8 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } } - parserTest("Test varargs overload") { + parserTestContainer("Test varargs overload") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { @@ -189,12 +185,10 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - parserTest("Test varargs overload with array") { - + parserTestContainer("Test varargs overload with array") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { - "of($t_SomeEnum_name.FOO, new $t_SomeEnum_name[]{$t_SomeEnum_name.BAR, $t_SomeEnum_name.BAR})" should parseAs { methodCall("of") { // SomeEnum @@ -243,10 +237,8 @@ class OverloadResolutionTest : ProcessorTestSpec({ } parserTest("Test overload resolution with unchecked conversion") { - doTest { - - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { int foo(Class k) {} // this is selected void foo(Object o) {} @@ -256,22 +248,21 @@ class OverloadResolutionTest : ProcessorTestSpec({ } } - """.trimIndent() - ) + """.trimIndent() + ) - val (fooClass) = acu.descendants(ASTMethodDeclaration::class.java).toList() + val (fooClass) = acu.descendants(ASTMethodDeclaration::class.java).toList() - val call = acu.descendants(ASTMethodCall::class.java).first()!! + val call = acu.descendants(ASTMethodCall::class.java).first()!! - call.shouldMatchN { - methodCall("foo") { - it shouldHaveType it.typeSystem.INT - it.methodType.symbol shouldBe fooClass.symbol + call.shouldMatchN { + methodCall("foo") { + it shouldHaveType it.typeSystem.INT + it.methodType.symbol shouldBe fooClass.symbol - argList { - variableAccess("k") { - it shouldHaveType with(it.typeDsl) { Class::class.raw } - } + argList { + variableAccess("k") { + it shouldHaveType with(it.typeDsl) { Class::class.raw } } } } @@ -280,9 +271,8 @@ class OverloadResolutionTest : ProcessorTestSpec({ parserTest("Test primitive conversion in loose phase") { inContext(ExpressionParsingCtx) { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Foo { void foo(long i) { foo('c'); @@ -290,33 +280,30 @@ class OverloadResolutionTest : ProcessorTestSpec({ void foo(String other) {} } - """ - ) + """ + ) - val fooM = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow() + val fooM = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow() - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("foo") { - it.methodType.apply { - formalParameters shouldBe listOf(it.typeSystem.LONG) - symbol shouldBe fooM.symbol - } - argList { - charLit("'c'") - } + call.shouldMatchN { + methodCall("foo") { + it.methodType.apply { + formalParameters shouldBe listOf(it.typeSystem.LONG) + symbol shouldBe fooM.symbol + } + argList { + charLit("'c'") } } } - } } parserTest("#4557 two overloads with boxed types") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ package p; import static p.Static.assertThat; @@ -342,21 +329,20 @@ class OverloadResolutionTest : ProcessorTestSpec({ } """.trimIndent() - ) + ) - val fooM = acu.methodDeclarations().firstOrThrow() - val call = acu.firstMethodCall() + val fooM = acu.methodDeclarations().firstOrThrow() + val call = acu.firstMethodCall() - call.overloadSelectionInfo.should { - it.isFailed shouldBe false - it.methodType.symbol shouldBe fooM.symbol - } + call.overloadSelectionInfo.should { + it.isFailed shouldBe false + it.methodType.symbol shouldBe fooM.symbol } } + parserTest("Two overloads with boxed types, widening required, ambiguous") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Static { static { // ambiguous: 1 is int, and neither Double nor Long is more @@ -374,18 +360,15 @@ class OverloadResolutionTest : ProcessorTestSpec({ } """.trimIndent() - ) + ) - val call = acu.firstMethodCall() - spy.shouldBeAmbiguous(call) - } + val call = acu.firstMethodCall() + spy.shouldBeAmbiguous(call) } - parserTest("Overload selection must identify fallbacks if any") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Arrays; import java.util.stream.Collectors; import java.lang.reflect.Type; @@ -406,52 +389,47 @@ class Scratch { .collect(Collectors.joining(", "))); } } - """.trimIndent() - ) + """.trimIndent() + ) - val fooCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val fooCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - fooCall.shouldMatchN { - methodCall("foo") { - argList { - methodCall("collect") { - it shouldHaveType with(it.typeDsl) { gen.t_String } + fooCall.shouldMatchN { + methodCall("foo") { + argList { + methodCall("collect") { + it shouldHaveType with(it.typeDsl) { gen.t_String } - methodCall("map") { - - it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_String] } - - it::getQualifier shouldBe methodCall("stream") { - it.overloadSelectionInfo.isVarargsCall shouldBe false - it shouldHaveType with(it.typeDsl) { gen.t_Stream[Class::class[`?`]] } - unspecifiedChild() - argList { - variableAccess("genArray") { - it shouldHaveType with(it.typeDsl) { Class::class[`?`].toArray() } - } - } - } + methodCall("map") { + it shouldHaveType with(it.typeDsl) { gen.t_Stream[gen.t_String] } + it::getQualifier shouldBe methodCall("stream") { + it.overloadSelectionInfo.isVarargsCall shouldBe false + it shouldHaveType with(it.typeDsl) { gen.t_Stream[Class::class[`?`]] } + unspecifiedChild() argList { - methodRef("getTypeName") { - with(it.typeDsl) { - it shouldHaveType gen.t_Function[Class::class[`?`], gen.t_String] - } - - skipQualifier() + variableAccess("genArray") { + it shouldHaveType with(it.typeDsl) { Class::class[`?`].toArray() } } } } + argList { + methodRef("getTypeName") { + with(it.typeDsl) { + it shouldHaveType gen.t_Function[Class::class[`?`], gen.t_String] + } - argList(1) + skipQualifier() + } + } } + + argList(1) } } } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt index b67320b2e8..838987cff1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverloadSpecificityTest.kt @@ -18,13 +18,10 @@ private val RefTypeConstants.t_Overloads: JClassType get() = ts.declaration(ts.getClassSymbol("net.sourceforge.pmd.lang.java.types.testdata.Overloads")!!) as JClassType class OverloadSpecificityTest : ProcessorTestSpec({ - - parserTest("Test strict overload") { - + parserTestContainer("Test strict overload") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { - "ambig(\"a\", \"b\")" should parseAs { methodCall("ambig") { with(it.typeDsl) { @@ -47,12 +44,10 @@ class OverloadSpecificityTest : ProcessorTestSpec({ } } - parserTest("Test generic varargs overload") { - + parserTestContainer("Test generic varargs overload") { asIfIn(Overloads::class.java) inContext(ExpressionParsingCtx) { - "genericOf(new String[] {\"\"})" should parseAs { methodCall("genericOf") { with(it.typeDsl) { @@ -76,8 +71,7 @@ class OverloadSpecificityTest : ProcessorTestSpec({ } } - parserTest("Test method hidden by enclosing class") { - + parserTestContainer("Test method hidden by enclosing class") { val acu = parser.parse( """ class Scratch { @@ -125,11 +119,9 @@ class Other { } } - parserTest("Test override from outside class") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Sup { void m() {} } @@ -146,22 +138,19 @@ class F { } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) } } parserTest("Test hidden method from outside class") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Sup { static void m() {} } @@ -176,22 +165,19 @@ class F { } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) } } parserTest("Test hidden method from outside class, when generic") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface Collection {} class Sup { static void m(Collection e) {} @@ -206,23 +192,19 @@ class F { Sub.m(); // should be Sub::m, no ambiguity } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) } } parserTest("Test hidden method inside class") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Sup { static void m() {} } @@ -233,23 +215,19 @@ class Sub extends Sup { Sub.m(); // should be Sub::m, no ambiguity } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - val (_, subM) = acu.methodDeclarations().toList { it.genericSignature } - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(subM) } } parserTest("Test hidden method inside hiding method") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Sup { static void m() {} } @@ -259,22 +237,19 @@ class Sub extends Sup { Sup.m(); } } + """.trimIndent() + ) - """.trimIndent() - ) + val (supM, _) = acu.methodDeclarations().toList { it.genericSignature } - val (supM, _) = acu.methodDeclarations().toList { it.genericSignature } - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(supM) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(supM) } } parserTest("Test distinct primitive overloads from import") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import static java.lang.Integer.reverseBytes; // (int) -> int import static java.lang.Long.reverseBytes; // (long) -> long @@ -283,28 +258,24 @@ class Scratch { reverseBytes(0L); } } + """.trimIndent() + ) - """.trimIndent() + val call = acu.firstMethodCall() + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "reverseBytes", + declaredIn = long.box(), + withFormals = listOf(long), + returning = long ) - - val call = acu.firstMethodCall() - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "reverseBytes", - declaredIn = long.box(), - withFormals = listOf(long), - returning = long - ) - } } } parserTest("Test specificity between generic ctors") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C { U fu; C() {} @@ -315,23 +286,18 @@ class C { C c = new C<>(new C<>(new C<>())); } } + """.trimIndent() + ) + val genericCtor = acu.ctorDeclarations().get(1)!!.genericSignature // new(C) - """.trimIndent() - ) - val genericCtor = acu.ctorDeclarations().get(1)!!.genericSignature // new(C) - - spy.shouldBeOk { - acu.firstCtorCall().methodType.shouldBeSomeInstantiationOf(genericCtor) - } + spy.shouldBeOk { + acu.firstCtorCall().methodType.shouldBeSomeInstantiationOf(genericCtor) } } - parserTest("Test specificity between generic and non-generic method") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { class ScratchOfInt extends Scratch {} @@ -343,22 +309,19 @@ class Scratch { getN(new ScratchOfInt()); } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, specific) = acu.methodDeclarations().toList { it.genericSignature } - val (_, specific) = acu.methodDeclarations().toList { it.genericSignature } - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(specific) - } + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldBeSomeInstantiationOf(specific) } } parserTest("Test specificity between lamdbas") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface Runnable { void run(); } @@ -378,27 +341,24 @@ class Scratch { bench("foo", () -> polyMethod()); // selects the supplier } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() - val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() + val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() - val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() - - spy.shouldBeOk { - ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) - voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) - stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) - polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) - } + spy.shouldBeOk { + ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) + voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) + stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) + polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) } } parserTest("Test specificity between exact mrefs") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface Runnable { void run(); } @@ -419,27 +379,24 @@ class Scratch { bench("foo", Scratch::polyMethod); // ambiguous } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() - val (_, _, withRunnable, withSupplier) = acu.declaredMethodSignatures() + val (ctor, voidM, stdM, polyM, ambigM) = acu.methodCalls().toList() - val (ctor, voidM, stdM, polyM, ambigM) = acu.methodCalls().toList() + spy.shouldBeAmbiguous(ambigM) - spy.shouldBeAmbiguous(ambigM) - - ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) - voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) - stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) - polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) - } + ctor.methodType.shouldBeSomeInstantiationOf(withSupplier) + voidM.methodType.shouldBeSomeInstantiationOf(withRunnable) + stdM.methodType.shouldBeSomeInstantiationOf(withSupplier) + polyM.methodType.shouldBeSomeInstantiationOf(withSupplier) } parserTest("Test specificity between implicitly typed lamdbas (ambiguous)") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface Runnable { void run(Object o); } @@ -459,16 +416,13 @@ class Scratch { bench("foo", o -> polyMethod()); // selects the supplier } } + """.trimIndent() + ) - """.trimIndent() - ) - - val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() - spy.shouldBeAmbiguous(ctor) - spy.shouldBeAmbiguous(voidM) - spy.shouldBeAmbiguous(stdM) - spy.shouldBeAmbiguous(polyM) - } + val (ctor, voidM, stdM, polyM) = acu.methodCalls().toList() + spy.shouldBeAmbiguous(ctor) + spy.shouldBeAmbiguous(voidM) + spy.shouldBeAmbiguous(stdM) + spy.shouldBeAmbiguous(polyM) } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt index 7cf6c31c23..c883e0d29e 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/OverridingTest.kt @@ -17,10 +17,8 @@ import kotlin.test.assertTrue */ class OverridingTest : ProcessorTestSpec({ - fun overridingSetup(name: String, mod: String) { - - parserTest(name) { + parserTestContainer(name) { val acu = parser.parse(""" class Scratch { $mod void m(Throwable t) { } @@ -36,7 +34,6 @@ class Other extends Scratch { val (scratchM, otherM, otherOverload) = acu.methodDeclarations().toList { it.genericSignature } - assert(TypeOps.areOverrideEquivalent(scratchM, otherM)) { "Precondition: override-equivalence" } @@ -44,6 +41,7 @@ class Other extends Scratch { fun doesOverride(m1: JMethodSig, m2: JMethodSig) = TypeOps.overrides(m1, m2, otherM.declaringType) + doTest("Other::m should override Scratch::m") { doesOverride(otherM, scratchM) shouldBe true } @@ -83,7 +81,7 @@ class Other extends Scratch { overridingSetup("Test package-private method overriding", "") - parserTest("Both inherited and visible from outer class") { + parserTestContainer("Both inherited and visible from outer class") { val acu = parser.parse(""" class Scratch { static void m(Throwable t) { } @@ -114,11 +112,9 @@ class Scratch { } } - parserTest("Primitive signatures do not merge") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { void m(long t) { } @@ -126,22 +122,19 @@ class Scratch { void m(int t) { } } } - """.trimIndent() - ) + """.trimIndent() + ) - val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } + val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } - - assertFalse("Methods are not override-equivalent") { - TypeOps.areOverrideEquivalent(scratchM, otherM) - } + assertFalse("Methods are not override-equivalent") { + TypeOps.areOverrideEquivalent(scratchM, otherM) } } parserTest("Primitive signatures do not merge 2") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { void m(int t) { } @@ -149,23 +142,20 @@ class Scratch { void m(long t) { } } } - """.trimIndent() - ) + """.trimIndent() + ) - val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } + val (scratchM, otherM) = acu.methodDeclarations().toList { it.genericSignature } - assertFalse("Methods are not override-equivalent") { - TypeOps.areOverrideEquivalent(scratchM, otherM) - } + assertFalse("Methods are not override-equivalent") { + TypeOps.areOverrideEquivalent(scratchM, otherM) } } - parserTest("Static generic method") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Sup { static E m(F e) { return null; } } @@ -179,22 +169,20 @@ class F { Sub.m(); // should be Sub::m, no ambiguity } } - """.trimIndent() - ) + """.trimIndent() + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - assertTrue("Methods are override-equivalent") { - TypeOps.areOverrideEquivalent(supE, subE) - } + assertTrue("Methods are override-equivalent") { + TypeOps.areOverrideEquivalent(supE, subE) } } parserTest("Static method with different bound") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; class Sup { static E m(F e) { return null; } @@ -212,31 +200,26 @@ class F { Sub.m(new F>()); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - // their type parameters have a different bound - // technically this is a compile-time error: - // both methods have the same erasure but neither hides the other - assertFalse("Methods should not override each other\n\t$subE\n\t$supE") { - TypeOps.overrides(subE, supE, subE.declaringType) - } - - spy.shouldBeAmbiguous(acu.firstMethodCall()) - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE + // their type parameters have a different bound + // technically this is a compile-time error: + // both methods have the same erasure but neither hides the other + assertFalse("Methods should not override each other\n\t$subE\n\t$supE") { + TypeOps.overrides(subE, supE, subE.declaringType) } + + spy.shouldBeAmbiguous(acu.firstMethodCall()) + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE } - - - parserTest("Static method of interface is not inherited!") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface List {} interface Sup { @@ -254,29 +237,25 @@ class F implements List> { Sub.m(new F>>()); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() - // their type parameters have a different bound - assertFalse("Methods should not be override-equivalent") { - TypeOps.overrides(subE, supE, subE.declaringType) - } + // their type parameters have a different bound + assertFalse("Methods should not be override-equivalent") { + TypeOps.overrides(subE, supE, subE.declaringType) + } - spy.shouldBeOk { - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE - } + spy.shouldBeOk { + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE } } - - parserTest("Static method of interface is not inherited in subinterfaces either") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface List {} interface Sup { @@ -294,26 +273,22 @@ class F implements List> { Sub.m(new F>>()); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (supE, subE) = acu.declaredMethodSignatures() + val (supE, subE) = acu.declaredMethodSignatures() + // their type parameters have a different bound + assertFalse("Methods should not be override-equivalent") { + TypeOps.overrides(subE, supE, subE.declaringType) + } - // their type parameters have a different bound - assertFalse("Methods should not be override-equivalent") { - TypeOps.overrides(subE, supE, subE.declaringType) - } - - spy.shouldBeOk { - acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE - } + spy.shouldBeOk { + acu.firstMethodCall().methodType shouldBeSomeInstantiationOf subE } } - - - parserTest("Private method shadowed in inner class") { + parserTestContainer("Private method shadowed in inner class") { val acu = parser.parse(""" class Scratch { private void m(Throwable t) { } // private methods are not overridden @@ -346,7 +321,7 @@ class Scratch { } } - parserTest("Merged abstract signature in class") { + parserTestContainer("Merged abstract signature in class") { val acu = parser.parse(""" class Scratch { static void m(Throwable t) { } @@ -377,5 +352,4 @@ class Scratch { doesOverride(scratchM, otherM) shouldBe false } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt index 90d3caf1ca..5afa8de6c6 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/PolyResolutionTest.kt @@ -17,11 +17,9 @@ import java.io.OutputStream * Expensive test cases for the overload resolution phase. */ class PolyResolutionTest : ProcessorTestSpec({ - parserTest("Test context passing overcomes null lower bound") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { java.util.List asList(T[] arr) { return null; } @@ -30,21 +28,19 @@ class PolyResolutionTest : ProcessorTestSpec({ java.util.List c = asList(null); } } - """ - ) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.`t_List{Integer}` - } + spy.shouldBeOk { + call shouldHaveType gen.`t_List{Integer}` } } parserTest("Test nested ternaries in invoc ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { static T id(T t) { return t; } @@ -55,38 +51,36 @@ class PolyResolutionTest : ProcessorTestSpec({ : Double.NaN); } } - """ - ) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("id") { - argList { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("id") { + argList { + ternaryExpr { + it shouldHaveType double + + unspecifiedChildren(2) ternaryExpr { it shouldHaveType double - unspecifiedChildren(2) - ternaryExpr { - it shouldHaveType double - - unspecifiedChildren(3) - } + unspecifiedChildren(3) } } } } - - call shouldHaveType double.box() } + + call shouldHaveType double.box() } } parserTest("Test standalonable ternary in invoc ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo {{ String packageName = "", className = ""; String.format("L%s%s%s;", @@ -94,24 +88,21 @@ class PolyResolutionTest : ProcessorTestSpec({ (packageName.length() > 0 ? "/" : ""), className); }} - """ - ) + """ + ) - val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + val ternary = acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() - spy.shouldBeOk { - // not String (this is not a standalone, just in an invocation ctx) - ternary shouldHaveType ts.OBJECT - } + spy.shouldBeOk { + // not String (this is not a standalone, just in an invocation ctx) + ternary shouldHaveType ts.OBJECT } } - parserTest("Ternary condition does not let context flow") { + parserTestContainer("Ternary condition does not let context flow") { suspend fun doTest(askOuterFirst: Boolean) { - val acu = parser.parse(""" - class O { public static double copySign(double magnitude, double sign) { return Math.copySign(magnitude, (Double.isNaN(sign) ? 1.0d : sign)); @@ -119,7 +110,6 @@ class O { } """.trimIndent()) - val (copySignCall) = acu.descendants(ASTMethodCall::class.java).toList() @@ -161,14 +151,11 @@ class O { doTest(askOuterFirst = true) doTest(askOuterFirst = false) - } - parserTest("Ternaries with an additive expr as context") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class O { public static String toString(Class c) { @@ -177,23 +164,19 @@ class O { } } """.trimIndent() - ) + ) - val additive = acu.descendants(ASTReturnStatement::class.java).firstOrThrow().expr!! + val additive = acu.descendants(ASTReturnStatement::class.java).firstOrThrow().expr!! - spy.shouldBeOk { - additive shouldHaveType ts.STRING - } + spy.shouldBeOk { + additive shouldHaveType ts.STRING } } - - parserTest("Standalone ctor in invocation ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.io.*; class O { @@ -202,28 +185,25 @@ class O { } } """.trimIndent() - ) + ) - val (outerCtor, innerCtor) = acu.ctorCalls().toList() + val (outerCtor, innerCtor) = acu.ctorCalls().toList() - spy.shouldBeOk { - outerCtor shouldHaveType DataOutputStream::class.raw - innerCtor shouldHaveType BufferedOutputStream::class.raw + spy.shouldBeOk { + outerCtor shouldHaveType DataOutputStream::class.raw + innerCtor shouldHaveType BufferedOutputStream::class.raw - innerCtor.overloadSelectionInfo.let { - it::isFailed shouldBe false - it::needsUncheckedConversion shouldBe false - } + innerCtor.overloadSelectionInfo.let { + it::isFailed shouldBe false + it::needsUncheckedConversion shouldBe false } } } - parserTest("Method call in invocation ctx of standalone ctor") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.io.*; class O { @@ -236,29 +216,25 @@ class O { } """.trimIndent() - ) + ) - val (outerCtor, wrapCall) = acu.descendants(InvocationNode::class.java).toList() + val (outerCtor, wrapCall) = acu.descendants(InvocationNode::class.java).toList() - spy.shouldBeOk { - outerCtor shouldHaveType DataOutputStream::class.raw - wrapCall shouldHaveType OutputStream::class.raw + spy.shouldBeOk { + outerCtor shouldHaveType DataOutputStream::class.raw + wrapCall shouldHaveType OutputStream::class.raw - wrapCall.overloadSelectionInfo.let { - it::isFailed shouldBe false - it::needsUncheckedConversion shouldBe false - } + wrapCall.overloadSelectionInfo.let { + it::isFailed shouldBe false + it::needsUncheckedConversion shouldBe false } } } - parserTest("Method call in some ternary bug") { - doTest { - val acu = parser.parse( - """ - + val acu = parser.parse( + """ class O { public static String getConnectPermission(Object url) { @@ -267,37 +243,31 @@ class O { urlString = urlString.substring(4, bangPos > -1 ? bangPos : urlString.length()); // <- HERE the call to length is bugged return urlString; } - } - """.trimIndent() - ) + """.trimIndent() + ) - val ternary = - acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + val ternary = + acu.descendants(ASTConditionalExpression::class.java).firstOrThrow() + + ternary.shouldMatchN { + ternaryExpr { + unspecifiedChild() + unspecifiedChild() + methodCall("length") { + it shouldHaveType it.typeSystem.INT - ternary.shouldMatchN { - ternaryExpr { unspecifiedChild() unspecifiedChild() - methodCall("length") { - it shouldHaveType it.typeSystem.INT - - unspecifiedChild() - unspecifiedChild() - } } } } - } - - parserTest("Cast context doesn't constrain invocation type") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ class Scratch { static T id(T t) { @@ -311,35 +281,32 @@ class Scratch { } } - """.trimIndent() - ) + """.trimIndent() + ) - val (t_Scratch) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (t_Scratch) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - call.shouldMatchN { - methodCall("id") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod( - named = "id", - declaredIn = t_Scratch, - withFormals = listOf(gen.t_Comparable), - returning = gen.t_Comparable - ) - } - - argList(1) + call.shouldMatchN { + methodCall("id") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod( + named = "id", + declaredIn = t_Scratch, + withFormals = listOf(gen.t_Comparable), + returning = gen.t_Comparable + ) } + + argList(1) } } } - parserTest("Test C-style array dimensions as target type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Iterator; import java.util.Map; @@ -352,27 +319,24 @@ class Scratch { } } - """.trimIndent() + """.trimIndent() + ) + + val t_Scratch = acu.firstTypeSignature() + + spy.shouldBeOk { + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "getArr", + declaredIn = t_Scratch, + withFormals = listOf(ts.STRING.toArray()), + returning = ts.STRING.toArray() ) - - val t_Scratch = acu.firstTypeSignature() - - spy.shouldBeOk { - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "getArr", - declaredIn = t_Scratch, - withFormals = listOf(ts.STRING.toArray()), - returning = ts.STRING.toArray() - ) - } } } parserTest("Array initializer is an assignment context") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { { Runnable[] r = { @@ -386,24 +350,21 @@ class Scratch { r = new Runnable[] { () -> { } }; // in array alloc } } + """.trimIndent() + ) - """.trimIndent() - ) + val (lambda1, lambda2, lambda3) = acu.descendants(ASTLambdaExpression::class.java).toList() - val (lambda1, lambda2, lambda3) = acu.descendants(ASTLambdaExpression::class.java).toList() - - spy.shouldBeOk { - lambda1 shouldHaveType Runnable::class.decl - lambda2 shouldHaveType Runnable::class.decl - lambda3 shouldHaveType Runnable::class.decl - } + spy.shouldBeOk { + lambda1 shouldHaveType Runnable::class.decl + lambda2 shouldHaveType Runnable::class.decl + lambda3 shouldHaveType Runnable::class.decl } } parserTest("Test inference with varargs - bug #4980") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.Stream; class Foo { @@ -415,21 +376,19 @@ class Scratch { return Stream.of(foo()); } } - """ - ) + """ + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call shouldHaveType gen.`t_Stream{Number}` - } + spy.shouldBeOk { + call shouldHaveType gen.`t_Stream{Number}` } } parserTest("Test bound checks does not throw concurrent mod exception") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.stream.Stream; class Enum> {} class EnumSet> { @@ -438,15 +397,14 @@ class Scratch { } private static > U[] getUniverse(Class elementType) {} } - """ - ) + """ + ) - val call = acu.firstMethodCall() - val xVar = acu.typeVar("X") + val call = acu.firstMethodCall() + val xVar = acu.typeVar("X") - spy.shouldBeOk { - call shouldHaveType xVar.toArray() - } + spy.shouldBeOk { + call shouldHaveType xVar.toArray() } } }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt index fff6dd8872..399c6f7ec4 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/SpecialMethodsTest.kt @@ -18,10 +18,7 @@ import java.util.function.Supplier * */ class SpecialMethodsTest : ProcessorTestSpec({ - - - parserTest("Test getClass special type") { - + parserTestContainer("Test getClass special type") { val (acu, spy) = parser.parseWithTypeInferenceSpy( """ import java.util.function.Function; @@ -93,73 +90,65 @@ class SpecialMethodsTest : ProcessorTestSpec({ } parserTest("Test enum methods") { - doTest { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + import java.util.Arrays; - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - import java.util.Arrays; + enum Foo { + ; - enum Foo { - ; - - { - Arrays.stream(values()); - } + { + Arrays.stream(values()); } - - """.trimIndent() - ) - - val t_Foo = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror - - val streamCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - spy.shouldBeOk { - streamCall shouldHaveType gen.t_Stream[t_Foo] - streamCall.arguments[0] shouldHaveType t_Foo.toArray() } + """.trimIndent() + ) + + val t_Foo = acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror + + val streamCall = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + + spy.shouldBeOk { + streamCall shouldHaveType gen.t_Stream[t_Foo] + streamCall.arguments[0] shouldHaveType t_Foo.toArray() } } parserTest("getClass in invocation ctx, unchecked conversion") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - - class Scratch { - public static T[] copyOf(U[] original, Class newType) { - return null; - } - - - public static T[] doCopy(T[] a) { - E[] elements = null; - return (T[]) copyOf(elements, a.getClass()); - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + public static T[] copyOf(U[] original, Class newType) { + return null; } - """.trimIndent() - ) - acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null + public static T[] doCopy(T[] a) { + E[] elements = null; + return (T[]) copyOf(elements, a.getClass()); + } + } + """.trimIndent() + ) - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + acu.descendants(ASTTypeDeclaration::class.java).firstOrThrow().typeMirror shouldNotBe null - spy.shouldBeOk { - call.shouldMatchN { - methodCall("copyOf") { - it shouldHaveType ts.OBJECT.toArray() + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - argList { - variableAccess("elements") + spy.shouldBeOk { + call.shouldMatchN { + methodCall("copyOf") { + it shouldHaveType ts.OBJECT.toArray() - methodCall("getClass") { - it shouldHaveType Class::class[`?` extends ts.OBJECT.toArray()] + argList { + variableAccess("elements") - variableAccess("a") + methodCall("getClass") { + it shouldHaveType Class::class[`?` extends ts.OBJECT.toArray()] - argList(0) - } + variableAccess("a") + + argList(0) } } } @@ -167,38 +156,31 @@ class SpecialMethodsTest : ProcessorTestSpec({ } } - parserTest("Record ctor formal param reference") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - - record Foo(int comp) { - Foo { - comp = comp - 1; - } + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + record Foo(int comp) { + Foo { + comp = comp - 1; } + } + """.trimIndent() + ) - """.trimIndent() - ) + val (compLhs, compRhs) = acu.descendants(ASTVariableAccess::class.java).toList() + val id = acu.varId("comp") - val (compLhs, compRhs) = acu.descendants(ASTVariableAccess::class.java).toList() - val id = acu.varId("comp") + spy.shouldBeOk { + compLhs.referencedSym.shouldBeA { + it.tryGetNode() shouldBe id + it.declaringSymbol.shouldBeA() + } - spy.shouldBeOk { - compLhs.referencedSym.shouldBeA { - it.tryGetNode() shouldBe id - it.declaringSymbol.shouldBeA() - } - - // same spec - compRhs.referencedSym.shouldBeA { - it.tryGetNode() shouldBe id - it.declaringSymbol.shouldBeA() - } + // same spec + compRhs.referencedSym.shouldBeA { + it.tryGetNode() shouldBe id + it.declaringSymbol.shouldBeA() } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index 11893082fc..bba1896c90 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -17,11 +17,8 @@ import net.sourceforge.pmd.lang.test.ast.shouldBe import net.sourceforge.pmd.lang.test.ast.shouldMatchN class StandaloneTypesTest : ProcessorTestSpec({ - - parserTest("Test array clone") { - + parserTestContainer("Test array clone") { inContext(ExpressionParsingCtx) { - fun matchArrayClone(compType: TypeDslMixin.() -> JTypeMirror) = parseAs { methodCall("clone") { @@ -46,11 +43,8 @@ class StandaloneTypesTest : ProcessorTestSpec({ } } - parserTest("Test array length") { - + parserTestContainer("Test array length") { inContext(ExpressionParsingCtx) { - - fun matchArrayLength(compType: TypeDslMixin.() -> JTypeMirror) = parseAs { fieldAccess("length") { @@ -71,13 +65,10 @@ class StandaloneTypesTest : ProcessorTestSpec({ } } - parserTest("Test binary numeric promotion on infix ops") { - + parserTestContainer("Test binary numeric promotion on infix ops") { inContext(ExpressionParsingCtx) { - listOf(ADD, MUL, SUB, MOD, DIV, OR, AND, XOR) .forEach { - val op = it.token "(byte) 1 $op (byte) 2" should haveType { int } @@ -90,45 +81,36 @@ class StandaloneTypesTest : ProcessorTestSpec({ "1f $op 2l" should haveType { float } "1f $op 2" should haveType { float } "1f $op 2d" should haveType { double } - } } } - parserTest("Test array initializer") { - doTest { - val block = StatementParsingCtx.parseNode("{ int[] is = { a }; int[][] iis = { { } }; }", ctx = this) - val (oneDim, twoDim, nested) = block.descendants(ASTArrayInitializer::class.java).toList() - with(block.typeDsl) { - oneDim shouldHaveType int.toArray() + val block = StatementParsingCtx.parseNode("{ int[] is = { a }; int[][] iis = { { } }; }", ctx = this) + val (oneDim, twoDim, nested) = block.descendants(ASTArrayInitializer::class.java).toList() + with(block.typeDsl) { + oneDim shouldHaveType int.toArray() - withClue("Multi dim array") { - twoDim shouldHaveType int.toArray(2) - nested shouldHaveType int.toArray() - } + withClue("Multi dim array") { + twoDim shouldHaveType int.toArray(2) + nested shouldHaveType int.toArray() } } } parserTest("Test array allocation") { - doTest { val block = StatementParsingCtx.parseNode("{ Object is = new int[0]; is = new String[0][]; }", ctx = this) val (intArray, stringArray) = block.descendants(ASTArrayAllocation::class.java).toList() with(block.typeDsl) { intArray shouldHaveType int.toArray() stringArray shouldHaveType ts.STRING.toArray(2) } - } } - parserTest("Test unary mutation expressions have the same type as the variable") { - + parserTestContainer("Test unary mutation expressions have the same type as the variable") { inContext(StatementParsingCtx) { - listOf(CHAR, BYTE, SHORT, INT, LONG).forEach { kind -> - "{ $kind v; v++; v--; --v; ++v; }" should parseAs { block { localVarDecl() @@ -156,13 +138,10 @@ class StandaloneTypesTest : ProcessorTestSpec({ } } - parserTest("Test unary numeric promotion on shift ops") { - + parserTestContainer("Test unary numeric promotion on shift ops") { inContext(ExpressionParsingCtx) { - listOf(LEFT_SHIFT, RIGHT_SHIFT, UNSIGNED_RIGHT_SHIFT) .forEach { - val op = it.token "(byte) 2 $op 2" should haveType { int } @@ -173,15 +152,12 @@ class StandaloneTypesTest : ProcessorTestSpec({ "2L $op 2" should haveType { long } "2D $op 2" should haveType { double } "2F $op 2" should haveType { float } - } } } - parserTest("Test boolean ops") { - + parserTestContainer("Test boolean ops") { inContext(ExpressionParsingCtx) { - listOf( CONDITIONAL_OR, CONDITIONAL_AND, @@ -194,25 +170,21 @@ class StandaloneTypesTest : ProcessorTestSpec({ LT ) .forEach { - val op = it.token "1 $op String" should haveType { boolean } - } } } - parserTest("Test assignment expr") { - + parserTestContainer("Test assignment expr") { inContext(StatementParsingCtx) { - """ { java.util.List l = java.util.Collections.emptyList(); l = l = l; } - """ should parseAs { + """ should parseAs { block { localVarDecl() exprStatement { @@ -254,29 +226,25 @@ class StandaloneTypesTest : ProcessorTestSpec({ } parserTest("Test field access on type variable") { - doTest { - val method = TypeBodyParsingCtx.parseNode(" void foo(T t) { t.length++; }", ctx = this) + val method = TypeBodyParsingCtx.parseNode(" void foo(T t) { t.length++; }", ctx = this) - val tvar = method.descendants(ASTTypeParameter::class.java).firstOrThrow().typeMirror - val fieldAccess = method.descendants(ASTFieldAccess::class.java).firstOrThrow() + val tvar = method.descendants(ASTTypeParameter::class.java).firstOrThrow().typeMirror + val fieldAccess = method.descendants(ASTFieldAccess::class.java).firstOrThrow() - fieldAccess.shouldMatchN { - fieldAccess("length") { - variableAccess("t") { - it shouldHaveType tvar - } - it shouldHaveType it.typeSystem.INT - it.referencedSym shouldNotBe null - it.referencedSym!!.enclosingClass shouldBe it.typeSystem.getClassSymbol(IntArray::class.java) + fieldAccess.shouldMatchN { + fieldAccess("length") { + variableAccess("t") { + it shouldHaveType tvar } + it shouldHaveType it.typeSystem.INT + it.referencedSym shouldNotBe null + it.referencedSym!!.enclosingClass shouldBe it.typeSystem.getClassSymbol(IntArray::class.java) } } } - parserTest("Test literals") { - + parserTestContainer("Test literals") { inContext(ExpressionParsingCtx) { - doTest("Booleans") { "true" should haveType { boolean } "false" should haveType { boolean } @@ -290,40 +258,37 @@ class StandaloneTypesTest : ProcessorTestSpec({ } parserTest("Test annotations in package-info") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ // in a package-info.java - @net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum( - value = net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum.Foo.A - ) - package foo; - - """.trimIndent() + @net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum( + value = net.sourceforge.pmd.lang.java.types.testdata.AnnotationWithEnum.Foo.A ) + package foo; + """.trimIndent() + ) - val annot = acu.descendants(ASTAnnotation::class.java).firstOrThrow() + val annot = acu.descendants(ASTAnnotation::class.java).firstOrThrow() - annot.withTypeDsl { - annot shouldHaveType AnnotationWithEnum::class.decl - val value = annot.members.firstOrThrow() - value.value.shouldMatchN { - fieldAccess("A") { - typeExpr { - classType("Foo") { - classType("AnnotationWithEnum") { - it::isFullyQualified shouldBe true - } + annot.withTypeDsl { + annot shouldHaveType AnnotationWithEnum::class.decl + val value = annot.members.firstOrThrow() + value.value.shouldMatchN { + fieldAccess("A") { + typeExpr { + classType("Foo") { + classType("AnnotationWithEnum") { + it::isFullyQualified shouldBe true } } - it shouldHaveType AnnotationWithEnum.Foo::class.decl } + it shouldHaveType AnnotationWithEnum.Foo::class.decl } } } } - parserTest("Test exception parameter") { + parserTestContainer("Test exception parameter") { inContext(StatementParsingCtx) { """ try {} @@ -357,20 +322,18 @@ class StandaloneTypesTest : ProcessorTestSpec({ block() } } - } - } } - parserTest("Test unboxed foreach parameter") { + parserTestContainer("Test unboxed foreach parameter") { inContext(StatementParsingCtx) { """ { java.util.List l = java.util.Collections.emptyList(); for (int controller : list); } - """ should parseAs { + """ should parseAs { block { localVarDecl() foreachLoop { @@ -384,5 +347,4 @@ class StandaloneTypesTest : ProcessorTestSpec({ } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt index b52288fa63..3a21c198bf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StressTest.kt @@ -33,7 +33,7 @@ class StressTest : ProcessorTestSpec({ println("[type inf stress test] $string") } - parserTest("Test hard overload resolution - no generics involved") { + parserTestContainer("Test hard overload resolution - no generics involved") { asIfIn(BoolLogic::class.java) fun TreeNodeWrapper.typeIs(value: Boolean) { @@ -113,52 +113,49 @@ class StressTest : ProcessorTestSpec({ } parserTest("OpenJDK bug 8055984: type inference exponential compilation performance") { - doTest { - // https://bugs.openjdk.java.net/browse/JDK-8055984 + // https://bugs.openjdk.java.net/browse/JDK-8055984 - val acu = parser.parse( - """ - class C { - U fu; - C() {} - C(C other) { this.fu = other.fu; } - C(U fu) { this.fu = fu; } - - static C m(C src) { return new C(src); } - - public static void main(String argv[]) { - /* type inference is expected here: */ - C c2 = m(new C<>(m(new C<>()))); - C c3 = m(new C<>(m(new C<>(m(new C<>()))))); - C c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))); // Javac(1.04), ECJ(.71s) - C c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))); // Javac(2.02s), ECJ(1.17s) - C c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))); // Javac(4.84s) ECJ(1.67s) - C c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))); // Javac(14.99s) ECJ(10.82s) - C c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))); // Javac(79.62s) ECJ(134.64s) - C c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))); // Javac(437s) ECJ(1305s) - C c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); // 3600 - } - } + val acu = parser.parse( """ - ) + class C { + U fu; + C() {} + C(C other) { this.fu = other.fu; } + C(U fu) { this.fu = fu; } - acu.descendants(ASTLocalVariableDeclaration::class.java) - .map { it.varIds[0]!!.initializer!! } - .forEachIndexed { i, expr -> - val t = measureTimeMillis { - expr.typeMirror shouldNotBe expr.typeSystem.UNKNOWN - } - myLog("c${i + 2}: $t ms") - } + static C m(C src) { return new C(src); } + + public static void main(String argv[]) { + /* type inference is expected here: */ + C c2 = m(new C<>(m(new C<>()))); + C c3 = m(new C<>(m(new C<>(m(new C<>()))))); + C c4 = m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))); // Javac(1.04), ECJ(.71s) + C c5 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))); // Javac(2.02s), ECJ(1.17s) + C c6 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))); // Javac(4.84s) ECJ(1.67s) + C c7 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))); // Javac(14.99s) ECJ(10.82s) + C c8 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))); // Javac(79.62s) ECJ(134.64s) + C c9 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))); // Javac(437s) ECJ(1305s) + C c10 = m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>(m(new C<>()))))))))))))))))))); // 3600 + } } + """ + ) + + acu.descendants(ASTLocalVariableDeclaration::class.java) + .map { it.varIds[0]!!.initializer!! } + .forEachIndexed { i, expr -> + val t = measureTimeMillis { + expr.typeMirror shouldNotBe expr.typeSystem.UNKNOWN + } + myLog("c${i + 2}: $t ms") + } } parserTest("OpenJDK bug 8225508: Compiler OOM Error with Type Inference Hierarchy") { - doTest { - // https://bugs.openjdk.java.net/browse/JDK-8225508 + // https://bugs.openjdk.java.net/browse/JDK-8225508 - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Arrays; import java.util.List; @@ -236,22 +233,21 @@ class StressTest : ProcessorTestSpec({ } } """.trimIndent() - ) + ) - acu.descendants(ASTLocalVariableDeclaration::class.java) - .map { it.varIds[0]!! } - .filter { it.name.startsWith("asList") } - .map { it.initializer!! } - .forEachIndexed { i, expr -> - val t = - measureTimeMillis { // todo these measurements are not accurate because typeres is done strictly now - assertFalse { - expr.typeMirror == expr.typeSystem.UNKNOWN - } + acu.descendants(ASTLocalVariableDeclaration::class.java) + .map { it.varIds[0]!! } + .filter { it.name.startsWith("asList") } + .map { it.initializer!! } + .forEachIndexed { i, expr -> + val t = + measureTimeMillis { // todo these measurements are not accurate because typeres is done strictly now + assertFalse { + expr.typeMirror == expr.typeSystem.UNKNOWN } - myLog("asList$i: $t ms") - } - } + } + myLog("asList$i: $t ms") + } } @@ -268,9 +264,7 @@ class StressTest : ProcessorTestSpec({ slow down the build too much. */ - parserTest("Test context passing in huge call chain") { - - + parserTestContainer("Test context passing in huge call chain") { asIfIn(TypeInferenceTestCases::class.java) // public static List m(List src) @@ -329,6 +323,4 @@ class StressTest : ProcessorTestSpec({ myLog("huge call chain: $t ms") } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt index 90a1557695..8639b8e4f0 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeAnnotationsInferenceTest.kt @@ -12,11 +12,9 @@ import net.sourceforge.pmd.lang.java.types.* /** */ class TypeAnnotationsInferenceTest : ProcessorTestSpec({ - parserTest("Test type annotation propagate even with boxing") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.lang.annotation.*; class Foo { @Target(ElementType.TYPE_USE) @@ -35,27 +33,25 @@ class Foo { } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, A) = acu.typeDeclarations().toList { it.symbol } + val (_, A) = acu.typeDeclarations().toList { it.symbol } - spy.shouldBeOk { - val `@A Integer` = `@`(A) on int.box() - acu.firstMethodCall() shouldHaveType `@A Integer` - acu.varId("i2") shouldHaveType `@A Integer` + spy.shouldBeOk { + val `@A Integer` = `@`(A) on int.box() + acu.firstMethodCall() shouldHaveType `@A Integer` + acu.varId("i2") shouldHaveType `@A Integer` - acu.methodCalls().get(1)!! shouldHaveType (`@`(A) on ts.STRING) - acu.varId("s2") shouldHaveType ts.STRING - } + acu.methodCalls().get(1)!! shouldHaveType (`@`(A) on ts.STRING) + acu.varId("s2") shouldHaveType ts.STRING } } parserTest("Test type annotations do not break wildcard capture") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.lang.annotation.*; class Foo { @Target(ElementType.TYPE_USE) @@ -68,22 +64,19 @@ class Foo { } } - """.trimIndent() + """.trimIndent() + ) + + val (_, A, t_Predicate) = acu.typeDeclarations().toList { it.symbol } + + + spy.shouldBeOk { + val `@A` = `@`(A) + acu.firstMethodCall() shouldHaveType boolean + acu.firstMethodCall().methodType.shouldMatchMethod( + named = "test", + declaredIn = t_Predicate[captureMatcher(`?` `super` (`@A` on acu.typeVar("T")))] ) - - val (_, A, t_Predicate) = acu.typeDeclarations().toList { it.symbol } - - - spy.shouldBeOk { - val `@A` = `@`(A) - acu.firstMethodCall() shouldHaveType boolean - acu.firstMethodCall().methodType.shouldMatchMethod( - named = "test", - declaredIn = t_Predicate[captureMatcher(`?` `super` (`@A` on acu.typeVar("T")))] - ) - } } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index 01f84f2c98..d877ef1b2c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt @@ -24,14 +24,11 @@ class TypeInferenceTest : ProcessorTestSpec({ val juf = "$jutil.function" val justream = "$jutil.stream" - parserTest("Test method invoc resolution") { - + parserTestContainer("Test method invoc resolution") { importedTypes += Arrays::class.java inContext(ExpressionParsingCtx) { - "Arrays.asList(\"a\")" should parseAs { - methodCall("asList") { val arraysClass = with(it.typeDsl) { java.util.Arrays::class.decl } val asList = arraysClass.getMethodsByName("asList")[0] @@ -54,36 +51,32 @@ class TypeInferenceTest : ProcessorTestSpec({ } parserTest("Test method invoc lub of params") { - importedTypes += Arrays::class.java - doTest { - val call = ExpressionParsingCtx.parseNode("Arrays.asList(1, 2.0)", ctx = this) as ASTMethodCall + val call = ExpressionParsingCtx.parseNode("Arrays.asList(1, 2.0)", ctx = this) as ASTMethodCall - val arraysClass = with(call.typeDsl) { Arrays::class.decl } - val asList = arraysClass.getMethodsByName("asList")[0] + val arraysClass = with(call.typeDsl) { Arrays::class.decl } + val asList = arraysClass.getMethodsByName("asList")[0] + call.overloadSelectionInfo.isVarargsCall shouldBe true + call.methodType.also { + it.isVarargs shouldBe true + val (formal, ret) = with(TypeDslOf(it.typeSystem)) { + // we can't hardcode the lub result because it is JDK specific + val `t_lub(Double, Integer)` = ts.lub(double.box(), int.box()) - call.overloadSelectionInfo.isVarargsCall shouldBe true - call.methodType.also { - it.isVarargs shouldBe true - val (formal, ret) = with(TypeDslOf(it.typeSystem)) { - // we can't hardcode the lub result because it is JDK specific - val `t_lub(Double, Integer)` = ts.lub(double.box(), int.box()) - - Pair( - `t_lub(Double, Integer)`, - gen.t_List[`t_lub(Double, Integer)`] - ) - } - - it.formalParameters[0].shouldBeA { - it.componentType shouldBe formal - } - - it.returnType shouldBe ret - it.typeParameters shouldBe asList.typeParameters // not substituted + Pair( + `t_lub(Double, Integer)`, + gen.t_List[`t_lub(Double, Integer)`] + ) } + + it.formalParameters[0].shouldBeA { + it.componentType shouldBe formal + } + + it.returnType shouldBe ret + it.typeParameters shouldBe asList.typeParameters // not substituted } } @@ -154,9 +147,7 @@ class TypeInferenceTest : ProcessorTestSpec({ } } - - parserTest("Test method call chain") { - + parserTestContainer("Test method call chain") { otherImports += "java.util.stream.*" inContext(ExpressionParsingCtx) { @@ -166,7 +157,7 @@ class TypeInferenceTest : ProcessorTestSpec({ } } - parserTest("Test method call chain as var initializer") { + parserTestContainer("Test method call chain as var initializer") { otherImports += "java.util.stream.*" inContext(StatementParsingCtx) { @@ -187,13 +178,12 @@ class TypeInferenceTest : ProcessorTestSpec({ } } - parserTest("Test many dependencies") { - + parserTestContainer("Test many dependencies") { inContext(StatementParsingCtx) { """ final $jutil.Map map = $justream.Stream.of("de", "").collect($justream.Collectors.toMap($juf.Function.identity(), $juf.Function.identity())); - """ should parseAs { + """ should parseAs { localVarDecl { localVarModifiers { } unspecifiedChild() @@ -229,11 +219,9 @@ class TypeInferenceTest : ProcessorTestSpec({ } } - parserTest("Test type var bound substitution in inherited members") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ interface I {} class C implements I {} @@ -248,24 +236,21 @@ class Scratch { } } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, t_C) = acu.declaredTypeSignatures() - val tParam = acu.typeVariables().first { it.name == "T" } + val (_, t_C) = acu.declaredTypeSignatures() + val tParam = acu.typeVariables().first { it.name == "T" } - spy.shouldBeOk { - // fixme this test could be better - acu.firstMethodCall() shouldHaveType t_C[tParam] // of T, not of O - } + spy.shouldBeOk { + // fixme this test could be better + acu.firstMethodCall() shouldHaveType t_C[tParam] // of T, not of O } } - parserTest("Test inference var inst substitution in enclosing ctx") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.ArrayList; import java.util.List; @@ -280,27 +265,24 @@ class Scratch { Object res = of(m(t)); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (ofCall, mCall) = acu.methodCalls().toList() - val (m, of) = acu.methodDeclarations().toList { it.genericSignature } + val (ofCall, mCall) = acu.methodCalls().toList() + val (m, of) = acu.methodDeclarations().toList { it.genericSignature } - spy.shouldBeOk { - ofCall shouldHaveType gen.`t_List{String}` - ofCall.methodType shouldBeSomeInstantiationOf of + spy.shouldBeOk { + ofCall shouldHaveType gen.`t_List{String}` + ofCall.methodType shouldBeSomeInstantiationOf of - mCall shouldHaveType gen.t_String - mCall.methodType shouldBeSomeInstantiationOf m - } + mCall shouldHaveType gen.t_String + mCall.methodType shouldBeSomeInstantiationOf m } } - parserTest("Constructor with inner class") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.util.Iterator; import java.util.Map; @@ -330,50 +312,47 @@ class MyMap { public K next() {return null;} } } + """.trimIndent() + ) - """.trimIndent() - ) + val (t_MyMap, t_MyMapEntry, t_KeyIter) = acu.descendants(ASTTypeDeclaration::class.java) + .toList { it.typeMirror } + val (kvar, vvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - val (t_MyMap, t_MyMapEntry, t_KeyIter) = acu.descendants(ASTTypeDeclaration::class.java) - .toList { it.typeMirror } - val (kvar, vvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + val ctorCall = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - val ctorCall = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + ctorCall.shouldMatchN { + constructorCall { + val `t_MyMap{K,V}KeyIter`: JClassType + val `t_MyMap{K,V}Entry`: JClassType - ctorCall.shouldMatchN { - constructorCall { - val `t_MyMap{K,V}KeyIter`: JClassType - val `t_MyMap{K,V}Entry`: JClassType + with(it.typeDsl) { + `t_MyMap{K,V}KeyIter` = t_MyMap[kvar, vvar].selectInner(t_KeyIter.symbol, emptyList()) + `t_MyMap{K,V}Entry` = t_MyMap[kvar, vvar].selectInner(t_MyMapEntry.symbol, emptyList()) - with(it.typeDsl) { - `t_MyMap{K,V}KeyIter` = t_MyMap[kvar, vvar].selectInner(t_KeyIter.symbol, emptyList()) - `t_MyMap{K,V}Entry` = t_MyMap[kvar, vvar].selectInner(t_MyMapEntry.symbol, emptyList()) - - it.methodType.shouldMatchMethod( - named = JConstructorSymbol.CTOR_NAME, - declaredIn = `t_MyMap{K,V}KeyIter`, - withFormals = listOf(`t_MyMap{K,V}Entry`, `t_MyMap{K,V}Entry`), - returning = `t_MyMap{K,V}KeyIter` - ) - } - - it::getTypeNode shouldBe classType("KeyIter") { - it shouldHaveType `t_MyMap{K,V}KeyIter` - } - - argList(2) + it.methodType.shouldMatchMethod( + named = JConstructorSymbol.CTOR_NAME, + declaredIn = `t_MyMap{K,V}KeyIter`, + withFormals = listOf(`t_MyMap{K,V}Entry`, `t_MyMap{K,V}Entry`), + returning = `t_MyMap{K,V}KeyIter` + ) } + + it::getTypeNode shouldBe classType("KeyIter") { + it shouldHaveType `t_MyMap{K,V}KeyIter` + } + + argList(2) } } } parserTest("Concurrent modification exception when propagating bounds modifies self var") { - doTest { - // problem is the ivar for E has Enum as upper bound and no Object, - // so Object is backpropagated to it during its own propagateAllBounds action + // problem is the ivar for E has Enum as upper bound and no Object, + // so Object is backpropagated to it during its own propagateAllBounds action - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Foo { void descendingKeyIterator() { @@ -388,20 +367,17 @@ class Foo { enum Tropes { FOO, BAR, baz } } - """.trimIndent() - ) + """.trimIndent() + ) - spy.shouldBeOk { - acu.firstMethodCall() shouldHaveType void - } + spy.shouldBeOk { + acu.firstMethodCall() shouldHaveType void } } - parserTest("#4902 bad intersection") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -422,16 +398,13 @@ public class BadIntersection { .collect(Collectors.toList()); } } - """.trimIndent() - ) + """.trimIndent() + ) - val (_, t_Animal) = acu.declaredTypeSignatures() + val (_, t_Animal) = acu.declaredTypeSignatures() - spy.shouldBeOk { - acu.firstMethodCall() shouldHaveType java.util.List::class[t_Animal] - } + spy.shouldBeOk { + acu.firstMethodCall() shouldHaveType java.util.List::class[t_Animal] } } - - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt index 76d93c9f54..301f0b5e0c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UncheckedInferenceTest.kt @@ -12,12 +12,9 @@ import net.sourceforge.pmd.lang.java.ast.* import net.sourceforge.pmd.lang.java.types.* class UncheckedInferenceTest : ProcessorTestSpec({ - parserTest("Test raw type in argument erases result") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C { static > T valueOf(Class k) { return null; } @@ -26,34 +23,30 @@ class C { var c = valueOf((Class) Object.class); } } + """.trimIndent() + ) - """.trimIndent() + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "valueOf", + declaredIn = t_C, + withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), + returning = gen.t_Comparable ) - - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "valueOf", - declaredIn = t_C, - withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), - returning = gen.t_Comparable - ) - call shouldHaveType gen.t_Comparable - id shouldHaveType gen.t_Comparable - call.shouldUseUncheckedConversion() - } + call shouldHaveType gen.t_Comparable + id shouldHaveType gen.t_Comparable + call.shouldUseUncheckedConversion() } } parserTest("Test raw type erases result (return type is Class)") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C { static > Class valueOf(Class k) { return null; } @@ -62,33 +55,30 @@ class C { Class c = valueOf((Class) Object.class); } } + """.trimIndent() + ) - """.trimIndent() + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + + val call = acu.firstMethodCall() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "valueOf", + declaredIn = t_C, + withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), + returning = Class::class.raw ) - - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - val call = acu.firstMethodCall() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "valueOf", - declaredIn = t_C, - withFormals = listOf(Class::class[gen.t_Comparable[`?`]]), - returning = Class::class.raw - ) - call shouldHaveType Class::class.raw - id shouldHaveType Class::class[`?`] - call.shouldUseUncheckedConversion() - } + call shouldHaveType Class::class.raw + id shouldHaveType Class::class[`?`] + call.shouldUseUncheckedConversion() } } parserTest("Test f-bound on raw type, explicit Object bound") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.*; class C { @@ -104,31 +94,27 @@ class C { } } + """.trimIndent() + ) - """.trimIndent() + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "min", + declaredIn = t_C, + withFormals = listOf(gen.t_Collection[`?` extends gen.t_Comparable]), // Comparable is raw + returning = gen.t_Comparable // not Object ) - - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "min", - declaredIn = t_C, - withFormals = listOf(gen.t_Collection[`?` extends gen.t_Comparable]), // Comparable is raw - returning = gen.t_Comparable // not Object - ) - call shouldHaveType gen.t_Comparable - call.shouldUseUncheckedConversion() - } + call shouldHaveType gen.t_Comparable + call.shouldUseUncheckedConversion() } } parserTest("Test f-bound on raw type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C { static > T valueOf(Class k) { return null; } @@ -137,35 +123,31 @@ class C { var c = valueOf((Class) Object.class); } } + """.trimIndent() + ) - """.trimIndent() + val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! + + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "valueOf", + declaredIn = t_C, + withFormals = listOf(Class::class[gen.t_Enum]), + returning = gen.t_Enum ) - - val (t_C) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - val id = acu.descendants(ASTVariableId::class.java).first { it.name == "c" }!! - - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "valueOf", - declaredIn = t_C, - withFormals = listOf(Class::class[gen.t_Enum]), - returning = gen.t_Enum - ) - call shouldHaveType gen.t_Enum - id shouldHaveType gen.t_Enum - call.shouldUseUncheckedConversion() - } + call shouldHaveType gen.t_Enum + id shouldHaveType gen.t_Enum + call.shouldUseUncheckedConversion() } } - parserTest("TODO unchecked assignment for intersection") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class Scratch { interface I {} @@ -176,29 +158,27 @@ class Scratch { N n = getN(); // unchecked assignment Scratch.I to N } } - """ + """ + ) + + val (t_Scratch, t_I) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } + val (nvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } + + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + + spy.shouldBeOk { + call.methodType.shouldMatchMethod( + named = "getN", + declaredIn = t_Scratch, + withFormals = emptyList(), + returning = nvar * t_I ) - - val (t_Scratch, t_I) = acu.descendants(ASTTypeDeclaration::class.java).toList { it.typeMirror } - val (nvar) = acu.descendants(ASTTypeParameter::class.java).toList { it.typeMirror } - - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - spy.shouldBeOk { - call.methodType.shouldMatchMethod( - named = "getN", - declaredIn = t_Scratch, - withFormals = emptyList(), - returning = nvar * t_I - ) - } } } parserTest("Raw type as target type") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import java.util.List; class Scratch { static { @@ -206,28 +186,26 @@ class Scratch { } static List asList(T... ts) { return null; } } - """ + """ + ) + + val (t_Scratch) = acu.typeDeclarations.toList { it.typeMirror } + val call = acu.firstMethodCall() + + spy.shouldBeOk { + call.overloadSelectionInfo.isFailed shouldBe false + call.methodType.shouldMatchMethod( + named = "asList", + declaredIn = t_Scratch, + withFormals = listOf(gen.t_String.toArray()), + returning = gen.`t_List{String}` ) - - val (t_Scratch) = acu.typeDeclarations.toList { it.typeMirror } - val call = acu.firstMethodCall() - - spy.shouldBeOk { - call.overloadSelectionInfo.isFailed shouldBe false - call.methodType.shouldMatchMethod( - named = "asList", - declaredIn = t_Scratch, - withFormals = listOf(gen.t_String.toArray()), - returning = gen.`t_List{String}` - ) - } } } parserTest("Type with raw bound") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ // Note: Enum is raw, not Enum class StringToEnum implements Converter { @@ -249,23 +227,21 @@ class StringToEnum implements Converter { interface Converter { To convert(From source); } - """ + """ + ) + + val call = acu.firstMethodCall() + val tparam = acu.typeVar("T") + + spy.shouldBeOk { + call.overloadSelectionInfo::isFailed shouldBe false + call.overloadSelectionInfo::needsUncheckedConversion shouldBe true + call.methodType.shouldMatchMethod( + named = "valueOf", + declaredIn = Enum::class.raw, + withFormals = listOf(Class::class[tparam], gen.t_String), + returning = Enum::class.raw ) - - val call = acu.firstMethodCall() - val tparam = acu.typeVar("T") - - spy.shouldBeOk { - call.overloadSelectionInfo::isFailed shouldBe false - call.overloadSelectionInfo::needsUncheckedConversion shouldBe true - call.methodType.shouldMatchMethod( - named = "valueOf", - declaredIn = Enum::class.raw, - withFormals = listOf(Class::class[tparam], gen.t_String), - returning = Enum::class.raw - ) - } } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt index 4cae6067cf..24d7ec3c04 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/UnresolvedTypesRecoveryTest.kt @@ -16,11 +16,9 @@ import net.sourceforge.pmd.lang.test.ast.shouldMatchN /** */ class UnresolvedTypesRecoveryTest : ProcessorTestSpec({ - parserTest("Test failed invoc context lets args be inferred as standalones") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.IOException; import ooo.Unresolved; @@ -32,43 +30,38 @@ class C { } } } + """.trimIndent() + ) - """.trimIndent() - ) + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - - call.shouldMatchN { - constructorCall { - classType("Unresolved") { - TypeOps.isUnresolved(it.typeMirror) shouldBe true - it.typeMirror.symbol.shouldBeA { - it.binaryName shouldBe "ooo.Unresolved" - } + call.shouldMatchN { + constructorCall { + classType("Unresolved") { + TypeOps.isUnresolved(it.typeMirror) shouldBe true + it.typeMirror.symbol.shouldBeA { + it.binaryName shouldBe "ooo.Unresolved" } + } - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror - argList { - methodCall("getMessage") { - it shouldHaveType it.typeSystem.STRING - variableAccess("ioe") - argList {} - } + argList { + methodCall("getMessage") { + it shouldHaveType it.typeSystem.STRING variableAccess("ioe") + argList {} } + variableAccess("ioe") } } } } - parserTest("Test constructor call fallback") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.IOException; import ooo.Unresolved; @@ -79,34 +72,31 @@ class C { } } - """.trimIndent() - ) + """.trimIndent() + ) + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - - call.shouldMatchN { - constructorCall { - classType("Unresolved") { - TypeOps.isUnresolved(it.typeMirror) shouldBe true - it.typeMirror.symbol.shouldBeA { - it.binaryName shouldBe "ooo.Unresolved" - } + call.shouldMatchN { + constructorCall { + classType("Unresolved") { + TypeOps.isUnresolved(it.typeMirror) shouldBe true + it.typeMirror.symbol.shouldBeA { + it.binaryName shouldBe "ooo.Unresolved" } - - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror - - argList {} } + + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror + + argList {} } } } parserTest("Test ctor fallback in invoc ctx") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.IOException; import ooo.Unresolved; @@ -120,32 +110,29 @@ class C { id(new Unresolved()); } } + """.trimIndent() + ) - """.trimIndent() - ) + val t_Unresolved = + acu.descendants(ASTConstructorCall::class.java).firstOrThrow().typeNode.typeMirror as JClassType + TypeOps.isUnresolved(t_Unresolved) shouldBe true - val t_Unresolved = - acu.descendants(ASTConstructorCall::class.java).firstOrThrow().typeNode.typeMirror as JClassType + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - TypeOps.isUnresolved(t_Unresolved) shouldBe true + call.shouldMatchN { + methodCall("id") { - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Unresolved), returning = t_Unresolved) - call.shouldMatchN { - methodCall("id") { + argList { + constructorCall { + classType("Unresolved") - it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Unresolved), returning = t_Unresolved) + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it shouldHaveType it.typeNode.typeMirror - argList { - constructorCall { - classType("Unresolved") - - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it shouldHaveType it.typeNode.typeMirror - - argList {} - } + argList {} } } } @@ -153,9 +140,8 @@ class C { } parserTest("Test diamond ctor for unresolved") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import java.io.IOException; import ooo.Unresolved; @@ -165,43 +151,37 @@ class C { Unresolved s = new Unresolved<>(); } } + """.trimIndent() + ) - """.trimIndent() - ) + val t_UnresolvedOfString = acu.descendants(ASTClassType::class.java) + .first { it.simpleName == "Unresolved" }!!.typeMirror.shouldBeA { + it.isParameterizedType shouldBe true + it.typeArgs shouldBe listOf(it.typeSystem.STRING) + } + TypeOps.isUnresolved(t_UnresolvedOfString) shouldBe true - val t_UnresolvedOfString = acu.descendants(ASTClassType::class.java) - .first { it.simpleName == "Unresolved" }!!.typeMirror.shouldBeA { - it.isParameterizedType shouldBe true - it.typeArgs shouldBe listOf(it.typeSystem.STRING) - } + val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() - TypeOps.isUnresolved(t_UnresolvedOfString) shouldBe true + call.shouldMatchN { + constructorCall { + classType("Unresolved") + it.usesDiamondTypeArgs() shouldBe true - val call = acu.descendants(ASTConstructorCall::class.java).firstOrThrow() + it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD + it.overloadSelectionInfo.isFailed shouldBe true + it shouldHaveType t_UnresolvedOfString - call.shouldMatchN { - constructorCall { - classType("Unresolved") - - it.usesDiamondTypeArgs() shouldBe true - - it.methodType shouldBe it.typeSystem.UNRESOLVED_METHOD - it.overloadSelectionInfo.isFailed shouldBe true - it shouldHaveType t_UnresolvedOfString - - argList {} - } + argList {} } } } - parserTest("Recovery for primitives in strict invoc") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import ooo.Unresolved; class C { @@ -212,30 +192,26 @@ class C { id(Unresolved.SOME_INT); } } + """.trimIndent() + ) - """.trimIndent() - ) + val idMethod = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow().symbol + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + call.shouldMatchN { + methodCall("id") { - val idMethod = acu.descendants(ASTMethodDeclaration::class.java).firstOrThrow().symbol + with(it.typeDsl) { + it.methodType.shouldMatchMethod("id", withFormals = listOf(int), returning = void) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe idMethod + } - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - call.shouldMatchN { - methodCall("id") { - - with(it.typeDsl) { - it.methodType.shouldMatchMethod("id", withFormals = listOf(int), returning = void) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe idMethod - } - - argList { - fieldAccess("SOME_INT") { - it shouldHaveType it.typeSystem.UNKNOWN - typeExpr { - classType("Unresolved") - } + argList { + fieldAccess("SOME_INT") { + it shouldHaveType it.typeSystem.UNKNOWN + typeExpr { + classType("Unresolved") } } } @@ -244,10 +220,8 @@ class C { } parserTest("Unresolved types are compatible in type variable bounds") { - doTest { - val acu = parser.parse( - """ - + val acu = parser.parse( + """ class C { static ooo.Foo foo() { return null; } @@ -259,37 +233,29 @@ class C { id(foo()); } } + """.trimIndent() + ) - """.trimIndent() - ) + val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") + idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + call.shouldMatchN { + methodCall("id") { - val (fooM, idM) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Foo), returning = t_Foo) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe idM - val t_Foo = fooM.getReturnType(Substitution.EMPTY).shouldBeUnresolvedClass("ooo.Foo") - idM.typeParameters[0].upperBound.shouldBeUnresolvedClass("ooo.Bound") - - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - - call.shouldMatchN { - methodCall("id") { - - it.methodType.shouldMatchMethod("id", withFormals = listOf(t_Foo), returning = t_Foo) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe idM - - - argList(1) - } + argList(1) } } } parserTest("Unresolved types are used in overload specificity tests") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C { static void foo(U1 u) { } @@ -300,43 +266,38 @@ class C { foo(u); } } + """.trimIndent() + ) - """.trimIndent() - ) + val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val (t_U1, t_U2) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + t_U1.shouldBeUnresolvedClass("U1") + t_U2.shouldBeUnresolvedClass("U2") - val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (t_U1, t_U2) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - t_U1.shouldBeUnresolvedClass("U1") - t_U2.shouldBeUnresolvedClass("U2") + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + it.methodType.shouldMatchMethod( + "foo", + withFormals = listOf(t_U1), + returning = it.typeSystem.NO_TYPE + ) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe foo1 - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { - - it.methodType.shouldMatchMethod( - "foo", - withFormals = listOf(t_U1), - returning = it.typeSystem.NO_TYPE - ) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe foo1 - - argList(1) - } + argList(1) } } } } parserTest("Superclass type is known in the subclass") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ class C extends U1 { static void foo(U1 u) { } @@ -346,41 +307,37 @@ class C extends U1 { foo(this); } } + """.trimIndent() + ) - """.trimIndent() - ) + val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } + val (t_U1) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + t_U1.shouldBeUnresolvedClass("U1") - val (foo1) = acu.descendants(ASTMethodDeclaration::class.java).toList { it.symbol } - val (t_U1) = acu.descendants(ASTClassType::class.java).toList { it.typeMirror } + val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() - t_U1.shouldBeUnresolvedClass("U1") + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - val call = acu.descendants(ASTMethodCall::class.java).firstOrThrow() + it.methodType.shouldMatchMethod( + "foo", + withFormals = listOf(t_U1), + returning = it.typeSystem.NO_TYPE + ) + it.overloadSelectionInfo.isFailed shouldBe false // it succeeded + it.methodType.symbol shouldBe foo1 - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { - - it.methodType.shouldMatchMethod( - "foo", - withFormals = listOf(t_U1), - returning = it.typeSystem.NO_TYPE - ) - it.overloadSelectionInfo.isFailed shouldBe false // it succeeded - it.methodType.symbol shouldBe foo1 - - argList(1) - } + argList(1) } } } } parserTest("Recovery when there are several applicable overloads") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import ooo.Unresolved; class C { @@ -397,30 +354,28 @@ class C { new StringBuilder().append(Unresolved.SOMETHING); } } + """.trimIndent() + ) - """.trimIndent() - ) + val call = acu.firstMethodCall() - val call = acu.firstMethodCall() + spy.shouldBeAmbiguous(call) + acu.withTypeDsl { + call.shouldMatchN { + methodCall("append") { - spy.shouldBeAmbiguous(call) - acu.withTypeDsl { - call.shouldMatchN { - methodCall("append") { + with(it.typeDsl) { + it.methodType.shouldMatchMethod("append", returning = gen.t_StringBuilder) + it.overloadSelectionInfo.isFailed shouldBe true // ambiguity + } - with(it.typeDsl) { - it.methodType.shouldMatchMethod("append", returning = gen.t_StringBuilder) - it.overloadSelectionInfo.isFailed shouldBe true // ambiguity - } + skipQualifier() - skipQualifier() - - argList { - fieldAccess("SOMETHING") { - it shouldHaveType it.typeSystem.UNKNOWN - typeExpr { - classType("Unresolved") - } + argList { + fieldAccess("SOMETHING") { + it shouldHaveType it.typeSystem.UNKNOWN + typeExpr { + classType("Unresolved") } } } @@ -430,15 +385,14 @@ class C { } parserTest("Recovery of unknown field using invocation context") { - doTest { - // This is ignored as doing this kind of thing would be impossible with - // laziness. If we want to resolve stuff like that, we have to resolve - // context first, then push it down into unresolved slots. But standalone - // exprs are used for disambiguation. So we'd probably have to split getTypeMirror - // into a top-down only and a user-facing one. + // This is ignored as doing this kind of thing would be impossible with + // laziness. If we want to resolve stuff like that, we have to resolve + // context first, then push it down into unresolved slots. But standalone + // exprs are used for disambiguation. So we'd probably have to split getTypeMirror + // into a top-down only and a user-facing one. - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ import ooo.Unresolved; class C { @@ -450,29 +404,28 @@ class C { } } - """.trimIndent() - ) + """.trimIndent() + ) - val call = acu.firstMethodCall() + val call = acu.firstMethodCall() - spy.shouldBeOk { - call.shouldMatchN { - methodCall("foo") { + spy.shouldBeOk { + call.shouldMatchN { + methodCall("foo") { - with(it.typeDsl) { - it.methodType.shouldMatchMethod("foo", withFormals = listOf(int), returning = void) - it.overloadSelectionInfo.isFailed shouldBe false - } + with(it.typeDsl) { + it.methodType.shouldMatchMethod("foo", withFormals = listOf(int), returning = void) + it.overloadSelectionInfo.isFailed shouldBe false + } - argList { - fieldAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType ts.UNKNOWN - it.referencedSym shouldBe null - } - typeExpr { - classType("Unresolved") - } + argList { + fieldAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType ts.UNKNOWN + it.referencedSym shouldBe null + } + typeExpr { + classType("Unresolved") } } } @@ -482,9 +435,8 @@ class C { } parserTest("Recovery of unknown field/var using assignment context") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import ooo.Unresolved; class C { @@ -496,38 +448,35 @@ class C { String k = SOMETHING; } } + """.trimIndent() + ) - """.trimIndent() - ) + val (field, unqual) = acu.descendants(ASTAssignableExpr.ASTNamedReferenceExpr::class.java).toList() - val (field, unqual) = acu.descendants(ASTAssignableExpr.ASTNamedReferenceExpr::class.java).toList() - - field.shouldMatchN { - fieldAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null - } - typeExpr { - classType("Unresolved") - } + field.shouldMatchN { + fieldAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null + } + typeExpr { + classType("Unresolved") } } - unqual.shouldMatchN { - variableAccess("SOMETHING") { - with(it.typeDsl) { - it shouldHaveType ts.STRING - it.referencedSym shouldBe null - } + } + unqual.shouldMatchN { + variableAccess("SOMETHING") { + with(it.typeDsl) { + it shouldHaveType ts.STRING + it.referencedSym shouldBe null } } } } parserTest("Unresolved type in primitive switch label") { - doTest { - val acu = parser.parse( - """ + val acu = parser.parse( + """ import ooo.Opcodes.*; class C { @@ -538,194 +487,181 @@ class C { } } } + """.trimIndent() + ) - """.trimIndent() - ) + val (_, a, b) = acu.descendants(ASTVariableAccess::class.java).toList() - val (_, a, b) = acu.descendants(ASTVariableAccess::class.java).toList() - - a.shouldMatchN { - variableAccess("A") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null - } + a.shouldMatchN { + variableAccess("A") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null } } - b.shouldMatchN { - variableAccess("B") { - with(it.typeDsl) { - it shouldHaveType int - it.referencedSym shouldBe null - } + } + b.shouldMatchN { + variableAccess("B") { + with(it.typeDsl) { + it shouldHaveType int + it.referencedSym shouldBe null } } } } parserTest("Unresolved lambda/mref target type has non-null functional method") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { - void foo(UnresolvedLambdaTarget lambda) { } - - void bar() { - foo(() -> null); // the target type is unresolved - foo(this::foo); // same - } + void foo(UnresolvedLambdaTarget lambda) { } + void bar() { + foo(() -> null); // the target type is unresolved + foo(this::foo); // same } - """.trimIndent() - ) - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() - val (mref) = acu.descendants(ASTMethodReference::class.java).toList() - - val (lambdaCall, mrefCall) = acu.descendants(ASTMethodCall::class.java).toList() - - spy.shouldHaveNoApplicableMethods(lambdaCall) - spy.shouldHaveNoApplicableMethods(mrefCall) - - acu.withTypeDsl { - lambda shouldHaveType ts.UNKNOWN - lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD - - mref shouldHaveType ts.UNKNOWN - mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD } + """.trimIndent() + ) + + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() + val (mref) = acu.descendants(ASTMethodReference::class.java).toList() + + val (lambdaCall, mrefCall) = acu.descendants(ASTMethodCall::class.java).toList() + + spy.shouldHaveNoApplicableMethods(lambdaCall) + spy.shouldHaveNoApplicableMethods(mrefCall) + + acu.withTypeDsl { + lambda shouldHaveType ts.UNKNOWN + lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD + + mref shouldHaveType ts.UNKNOWN + mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD } } parserTest("No context for lambda/mref") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { - void foo(UnresolvedLambdaTarget lambda) { } - - void bar() { - () -> null; - return this::foo; // return onto void - } + void foo(UnresolvedLambdaTarget lambda) { } + void bar() { + () -> null; + return this::foo; // return onto void } - """.trimIndent() - ) - val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() - val (mref) = acu.descendants(ASTMethodReference::class.java).toList() - - spy.shouldHaveNoLambdaCtx(lambda) - spy.shouldHaveNoLambdaCtx(mref) - - acu.withTypeDsl { - lambda shouldHaveType ts.UNKNOWN - lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD - - mref shouldHaveType ts.UNKNOWN - mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD - mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD } + """.trimIndent() + ) + + val (lambda) = acu.descendants(ASTLambdaExpression::class.java).toList() + val (mref) = acu.descendants(ASTMethodReference::class.java).toList() + + spy.shouldHaveNoLambdaCtx(lambda) + spy.shouldHaveNoLambdaCtx(mref) + + acu.withTypeDsl { + lambda shouldHaveType ts.UNKNOWN + lambda.functionalMethod shouldBe ts.UNRESOLVED_METHOD + + mref shouldHaveType ts.UNKNOWN + mref.functionalMethod shouldBe ts.UNRESOLVED_METHOD + mref.referencedMethod shouldBe ts.UNRESOLVED_METHOD } } parserTest("Wrong syntax, return with expr in void method") { - doTest { - val (acu, spy) = parser.parseWithTypeInferenceSpy( - """ - class Foo { - void foo() { return foo; } - static { return p1; } - Foo() { return p2; } - } - """ - ) + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Foo { + void foo() { return foo; } + static { return p1; } + Foo() { return p2; } + } + """ + ) - for (vaccess in acu.descendants(ASTVariableAccess::class.java)) { - spy.shouldBeOk { - vaccess shouldHaveType ts.UNKNOWN - } + for (vaccess in acu.descendants(ASTVariableAccess::class.java)) { + spy.shouldBeOk { + vaccess shouldHaveType ts.UNKNOWN } } } parserTest("Lambda with wrong form") { - doTest { - val (acu, _) = parser.parseWithTypeInferenceSpy( - """ - interface Lambda { - void call(); - } - class Foo { - { - Lambda l = () -> {}; // ok - Lambda l = x -> {}; // wrong form! - } - } - """ - ) - - val (ok, wrong) = acu.descendants(ASTLambdaExpression::class.java).toList() - val t_Lambda = acu.typeDeclarations.firstOrThrow().typeMirror - - acu.withTypeDsl { - ok shouldHaveType t_Lambda - wrong shouldHaveType t_Lambda - wrong.parameters[0] shouldHaveType ts.UNKNOWN + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ + interface Lambda { + void call(); } + class Foo { + { + Lambda l = () -> {}; // ok + Lambda l = x -> {}; // wrong form! + } + } + """ + ) + + val (ok, wrong) = acu.descendants(ASTLambdaExpression::class.java).toList() + val t_Lambda = acu.typeDeclarations.firstOrThrow().typeMirror + + acu.withTypeDsl { + ok shouldHaveType t_Lambda + wrong shouldHaveType t_Lambda + wrong.parameters[0] shouldHaveType ts.UNKNOWN } } parserTest("Method ref in unresolved call chain") { - doTest { - /* - In this test we have Stream.of(/*some expr with unresolved type*/) + /* + In this test we have Stream.of(/*some expr with unresolved type*/) - The difficult thing is that Stream.of has two overloads: of(U) and of(U...), - and the argument is unknown. This makes both methods match. Whichever method is matched, - we want the U to be inferred to (*unknown*) and not Object. - */ + The difficult thing is that Stream.of has two overloads: of(U) and of(U...), + and the argument is unknown. This makes both methods match. Whichever method is matched, + we want the U to be inferred to (*unknown*) and not Object. + */ - val (acu, _) = parser.parseWithTypeInferenceSpy( - """ - interface Function { - R call(T parm); - } - interface Stream { - Stream map(Function fun); - - // the point of this test is there is an ambiguity between both of these overloads - static Stream of(U u) {} - static Stream of(U... u) {} - } - class Foo { - { - // var i = Stream.of("").map(Foo::toInt); - var x = Stream.of(new Unresolved().getString()) - .map(Foo::toInt); - } - private static Integer toInt(String s) {} - } - """ - ) - - val (fooToInt) = acu.descendants(ASTMethodReference::class.java).toList() - val (map, streamOf, _) = acu.methodCalls().toList() - val (t_Function, t_Stream, _) = acu.declaredTypeSignatures() - val (_, _, _, _, toIntFun) = acu.methodDeclarations().toList { it.symbol } - - acu.withTypeDsl { - streamOf shouldHaveType t_Stream[ts.UNKNOWN] - map shouldHaveType t_Stream[ts.INT.box()] - fooToInt shouldHaveType t_Function[ts.UNKNOWN, ts.INT.box()] - fooToInt.referencedMethod.symbol shouldBe toIntFun + val (acu, _) = parser.parseWithTypeInferenceSpy( + """ + interface Function { + R call(T parm); } + interface Stream { + Stream map(Function fun); + + // the point of this test is there is an ambiguity between both of these overloads + static Stream of(U u) {} + static Stream of(U... u) {} + } + class Foo { + { + // var i = Stream.of("").map(Foo::toInt); + var x = Stream.of(new Unresolved().getString()) + .map(Foo::toInt); + } + private static Integer toInt(String s) {} + } + """ + ) + + val (fooToInt) = acu.descendants(ASTMethodReference::class.java).toList() + val (map, streamOf, _) = acu.methodCalls().toList() + val (t_Function, t_Stream, _) = acu.declaredTypeSignatures() + val (_, _, _, _, toIntFun) = acu.methodDeclarations().toList { it.symbol } + + acu.withTypeDsl { + streamOf shouldHaveType t_Stream[ts.UNKNOWN] + map shouldHaveType t_Stream[ts.INT.box()] + fooToInt shouldHaveType t_Function[ts.UNKNOWN, ts.INT.box()] + fooToInt.referencedMethod.symbol shouldBe toIntFun } } - }) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt index f745f0fc2d..1a34c89138 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/ast/CtorInvocMirrorTest.kt @@ -11,46 +11,41 @@ import net.sourceforge.pmd.lang.java.ast.ProcessorTestSpec import net.sourceforge.pmd.lang.java.types.shouldBeUnresolvedClass class CtorInvocMirrorTest : ProcessorTestSpec({ - parserTest("Qualified constructor invocation with unresolved types") { - doTest { - val acu = parser.parse( - """ - class Foo { - void bar() { - Foo myObject = new Foo(); - myObject.new Nested(); - } - - class Nested {} + val acu = parser.parse( + """ + class Foo { + void bar() { + Foo myObject = new Foo(); + myObject.new Nested(); } - """ - ) - val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! - invocation.typeMirror shouldNotBe null - invocation.typeMirror.shouldBeUnresolvedClass("Foo.Nested") - } + + class Nested {} + } + """ + ) + val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! + invocation.typeMirror shouldNotBe null + invocation.typeMirror.shouldBeUnresolvedClass("Foo.Nested") } parserTest("Qualified constructor invocation with unresolved types uncompilable") { - doTest { - val acu = parser.parse( - """ - class Foo { - void bar() { - Foo myObject = new Foo(); - myObject.new Nested(); - } - - //the nested type is not declared, so this code actually doesn't compile - //but PMD should not crash - //class Nested {} + val acu = parser.parse( + """ + class Foo { + void bar() { + Foo myObject = new Foo(); + myObject.new Nested(); } - """ - ) - val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! - invocation.typeMirror shouldNotBe null - invocation.typeMirror.shouldBeSameInstanceAs(invocation.typeSystem.UNKNOWN) - } + + //the nested type is not declared, so this code actually doesn't compile + //but PMD should not crash + //class Nested {} + } + """ + ) + val invocation = acu.descendants(ASTConstructorCall::class.java).get(1)!! + invocation.typeMirror shouldNotBe null + invocation.typeMirror.shouldBeSameInstanceAs(invocation.typeSystem.UNKNOWN) } }) From 8b50584af4e3d7f69cf004512dbb3e0b559d3345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 21 May 2024 15:46:54 +0200 Subject: [PATCH 088/121] Add some tests --- .../pmd/lang/java/ast/ASTLiteralTest.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt index 13de3376c1..32e5fc5a9c 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ASTLiteralTest.kt @@ -408,6 +408,23 @@ $delim it::getBase shouldBe 10 } } + + "0." should parseAs { + number(DOUBLE) { + it::getBase shouldBe 10 + } + } + val doubleOrFloatInBase10: NodeSpec<*> = { + number { + it::getBase shouldBe 10 + } + } + "05e10" should parseAs(doubleOrFloatInBase10) + "05e10f" should parseAs(doubleOrFloatInBase10) + "00f" should parseAs(doubleOrFloatInBase10) + "00d" should parseAs(doubleOrFloatInBase10) + "00D" should parseAs(doubleOrFloatInBase10) + "050.0" should parseAs(doubleOrFloatInBase10) } } @@ -424,6 +441,7 @@ $delim it::getValueAsDouble shouldBe 30.0 it::getValueAsFloat shouldBe 30f it::getValueAsInt shouldBe 30 + it::getBase shouldBe 16 } } @@ -436,6 +454,7 @@ $delim it::getValueAsDouble shouldBe 7.5 it::getValueAsFloat shouldBe 7.5f it::getValueAsInt shouldBe 7 + it::getBase shouldBe 16 } } @@ -458,6 +477,7 @@ $delim it::getValueAsFloat shouldBe 15f it::getValueAsInt shouldBe 15 it::getValueAsLong shouldBe 15L + it::getBase shouldBe 16 } } @@ -508,6 +528,7 @@ $delim it::getValueAsFloat shouldBe 3f it::getValueAsInt shouldBe 3 it::getValueAsLong shouldBe 3L + it::getBase shouldBe 2 } } From d005ed197ffe6df6ddda4cdf291cb85033c97c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 21 May 2024 15:52:31 +0200 Subject: [PATCH 089/121] Update release notes, ref #5020 --- docs/pages/release_notes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index f258a94d08..0d7a371c6e 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -44,6 +44,7 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources * java-errorprone * [#4042](https://github.com/pmd/pmd/issues/4042): \[java] A false negative about the rule StringBufferInstantiationWithChar + * [#5007](https://github.com/pmd/pmd/issues/5007): \[java] AvoidUsingOctalValues triggers on non-octal double literals with a leading 0 * java-multithreading * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer @@ -56,5 +57,7 @@ Since this release, PMD will also expose any getter returning a collection of an ### โœจ External Contributions +* [#5020](https://github.com/pmd/pmd/issues/5020): \[java] Fix AvoidUsingOctalValues false-positive - [Gold856](https://github.com/Gold856) (@Gold856) + {% endtocmaker %} From bbec7fd3a21368b3fe4197ebbf72e80ebc9a28ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Tue, 21 May 2024 16:35:30 +0200 Subject: [PATCH 090/121] Add test for #4990 Ref #4946 --- .../pmd/lang/java/ast/ASTClassTypeTest.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ASTClassTypeTest.java diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ASTClassTypeTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ASTClassTypeTest.java new file mode 100644 index 0000000000..ec218b5e78 --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ASTClassTypeTest.java @@ -0,0 +1,35 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.List; + +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.java.BaseParserTest; + +class ASTClassTypeTest extends BaseParserTest { + + @Test + void testGithub4990() { + ASTCompilationUnit acu = java.parse( + "import java.util.*;\n" + + "\n" + + "public class Test {\n" + + " public void Test() {\n" + + " boolean good4 = java.util.Collections.emptyList(); // Line 6\n" + + " }\n" + + "}"); + List types = acu.descendants(ASTClassType.class).toList(); + + ASTClassType ct = types.get(0); + assertEquals("Collections", ct.getSimpleName()); + assertEquals("java.util", ct.getPackageQualifier()); + + } + +} From 5b24bbea87fea0c2cc5356503f3336a30a6b7fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 22 May 2024 16:58:41 +0200 Subject: [PATCH 091/121] Fix #5029 - infinite recursion in TypeOps::projectUpwards --- .../pmd/lang/java/types/TypeOps.java | 12 +++------ .../pmd/lang/java/types/TypeOpsTest.kt | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 0398a5c2d8..079f4bd3e4 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -1091,14 +1091,10 @@ public final class TypeOps { JTypeMirror recurseIfNotDone(T t, BiFunction body) { if (t instanceof JTypeVar) { JTypeVar var = (JTypeVar) t; - try { - if (isAbsent(var)) { - return body.apply(t, this); - } else { - return t; - } - } finally { - set.remove(var); + if (isAbsent(var)) { + return body.apply(t, this); + } else { + return t; } } else { return body.apply(t, this); diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeOpsTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeOpsTest.kt index c1e759ab9c..55a1b19a82 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeOpsTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/TypeOpsTest.kt @@ -69,6 +69,32 @@ class TypeOpsTest : FunSpec({ output = listOf(`t_List{String}`, `t_List{Integer}`)) } + + test("Bug #5029: Recursive type projection") { + + val (acu, spy) = javaParser.parseWithTypeInferenceSpy( + """ + class Job, R extends Run> { + J getLast() { return null; } + } + class Run, R extends Run> {} + + class Foo { + static Job foo(Job job) { + var x = job.getLast(); + return x; + } + } + """.trimIndent() + ) + val (jobt, runt) = acu.declaredTypeSignatures() + val xVar = acu.varId("x") + spy.shouldBeOk { + xVar shouldHaveType jobt[`?` extends jobt[`?`, `?` extends runt[`?`, `?`]], `?`] + } + + + } } } From ec30fe1b01d5da437e5cd3dbcfa78d57ab2d8248 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 08:43:31 +0200 Subject: [PATCH 092/121] Update gems - Bump nokogiri from 1.16.2 to 1.16.5 - Bump rexml from 3.2.6 to 3.2.8 Fixes https://github.com/pmd/pmd/security/dependabot/52 Fixes https://github.com/pmd/pmd/security/dependabot/53 Fixes https://github.com/advisories/GHSA-r95h-9x8f-r3f7 Fixes https://github.com/pmd/pmd/security/dependabot/56 Fixes https://github.com/pmd/pmd/security/dependabot/57 Fixes https://github.com/advisories/GHSA-vg3r-rm7w-2xgh Fixes CVE-2024-35176 --- Gemfile.lock | 22 ++++++++++++---------- docs/Gemfile.lock | 30 ++++++++++++++---------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 10d7e8eadd..858d9626a0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) claide (1.1.0) claide-plugins (0.9.2) cork @@ -28,7 +28,7 @@ GEM octokit (>= 4.0) terminal-table (>= 1, < 4) differ (0.1.2) - et-orbi (1.2.8) + et-orbi (1.2.11) tzinfo faraday (2.9.0) faraday-net_http (>= 2.0, < 3.2) @@ -36,8 +36,8 @@ GEM faraday (>= 0.8) faraday-net_http (3.1.0) net-http - fugit (1.10.1) - et-orbi (~> 1, >= 1.2.7) + fugit (1.11.0) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) git (1.19.1) addressable (~> 2.8) @@ -46,13 +46,13 @@ GEM rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (5.4.0) + liquid (5.5.0) logger-colors (1.0.0) nap (1.1.0) net-http (0.4.1) uri no_proxy_fix (0.1.2) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) octokit (8.1.0) base64 @@ -66,12 +66,13 @@ GEM nokogiri (~> 1.13) rufus-scheduler (~> 3.8) slop (~> 4.9) - public_suffix (5.0.4) + public_suffix (5.0.5) raabro (1.4.0) - racc (1.7.3) + racc (1.8.0) rchardet (1.8.0) - rexml (3.2.6) - rouge (4.2.0) + rexml (3.2.8) + strscan (>= 3.0.9) + rouge (4.2.1) rufus-scheduler (3.9.1) fugit (~> 1.1, >= 1.1.6) safe_yaml (1.0.5) @@ -79,6 +80,7 @@ GEM addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) slop (4.10.1) + strscan (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) tzinfo (2.0.6) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 8f8b94acac..bd44b12521 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -14,7 +14,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) coffee-script (2.4.1) coffee-script-source execjs @@ -23,8 +23,8 @@ GEM commonmarker (0.23.10) concurrent-ruby (1.2.3) connection_pool (2.4.1) - csv (3.2.8) - dnsruby (1.71.0) + csv (3.3.0) + dnsruby (1.72.1) simpleidn (~> 0.2.1) drb (2.2.1) em-websocket (0.5.3) @@ -96,7 +96,7 @@ GEM activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) jekyll (3.9.5) addressable (~> 2.4) @@ -219,23 +219,24 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.22.2) + minitest (5.23.1) mutex_m (0.2.0) net-http (0.4.1) uri - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.4) - racc (1.7.3) + public_suffix (5.0.5) + racc (1.8.0) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (3.30.0) rubyzip (2.3.2) safe_yaml (1.0.5) @@ -247,17 +248,14 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - simpleidn (0.2.1) - unf (~> 0.1.4) + simpleidn (0.2.3) + strscan (3.1.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.9.1) unicode-display_width (1.8.0) uri (0.13.0) webrick (1.8.1) From 5bc0ab04039becaa685def13e0abd06aab4fb55a Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 09:45:08 +0200 Subject: [PATCH 093/121] [doc] Update release notes (#4990, #5005) --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0d7a371c6e..c3db4d3567 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -34,6 +34,7 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration + * [#4990](https://github.com/pmd/pmd/issues/4990): \[java] Add an attribute @PackageQualifier to ASTClassType * [#5006](https://github.com/pmd/pmd/issues/5006): \[java] Bad intersection, unrelated class types Child and Parent * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name From a54dc1ea8914f99228578dcc6a9f8b0dc38a7268 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 10:24:31 +0200 Subject: [PATCH 094/121] [java] Add Java8TreeDumpTest for UnnamedVariable Refs #5004 --- .../lang/java/ast/AllJavaAstTreeDumpTest.java | 1 + .../pmd/lang/java/ast/Java8TreeDumpTest.java | 29 +++++++++++++++++++ .../java8/UnnamedVariable.java | 16 ++++++++++ .../jdkversiontests/java8/UnnamedVariable.txt | 24 +++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java8TreeDumpTest.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.java create mode 100644 pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.txt 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 cd1e20ef28..c32f06139a 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 @@ -10,6 +10,7 @@ import org.junit.platform.suite.api.Suite; @Suite @SelectClasses({ ParserCornersTest.class, + Java8TreeDumpTest.class, Java9TreeDumpTest.class, Java14TreeDumpTest.class, Java15TreeDumpTest.class, diff --git a/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java8TreeDumpTest.java b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java8TreeDumpTest.java new file mode 100644 index 0000000000..a28b11172c --- /dev/null +++ b/pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/Java8TreeDumpTest.java @@ -0,0 +1,29 @@ +/** + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +package net.sourceforge.pmd.lang.java.ast; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.junit.jupiter.api.Test; + +import net.sourceforge.pmd.lang.java.BaseJavaTreeDumpTest; +import net.sourceforge.pmd.lang.java.JavaParsingHelper; +import net.sourceforge.pmd.lang.test.ast.BaseParsingHelper; + +class Java8TreeDumpTest extends BaseJavaTreeDumpTest { + + private final JavaParsingHelper java8 = JavaParsingHelper.DEFAULT + .withDefaultVersion("8") + .withResourceContext(Java8TreeDumpTest.class, "jdkversiontests/java8"); + + @Test + void unnamedVariablesAreAllowedWithJava8() { + doTest("UnnamedVariable"); + } + + @Override + public @NonNull BaseParsingHelper getParser() { + return java8; + } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.java b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.java new file mode 100644 index 0000000000..16421ab0ae --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.java @@ -0,0 +1,16 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +/** + * See https://github.com/pmd/pmd/pull/5004: With Java 22, "_" are unnamed variables. + * In Java 9-21 "_" is a restricted keyword and cannot be used as a variable name. + * Before Java 9, "_" is still a valid name, but not a unnmaed variable. + */ +class UnnamedVariable { + void method() { + int _ = 1; + } + + void method2(int _) { } +} diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.txt b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.txt new file mode 100644 index 0000000000..229863a9ad --- /dev/null +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java8/UnnamedVariable.txt @@ -0,0 +1,24 @@ ++- CompilationUnit[@PackageName = ""] + +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "UnnamedVariable", @CanonicalName = "UnnamedVariable", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "UnnamedVariable", @Static = false, @TopLevel = true, @Visibility = Visibility.V_PACKAGE] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] + +- ClassBody[@Empty = false, @Size = 2] + +- MethodDeclaration[@Abstract = false, @Arity = 0, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "method", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] + | +- VoidType[] + | +- FormalParameters[@Empty = true, @Size = 0] + | +- Block[@Empty = false, @Size = 1, @containsComment = false] + | +- LocalVariableDeclaration[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @TypeInferred = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- VariableDeclarator[@Initializer = true, @Name = "_"] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = true, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] + | +- NumericLiteral[@Base = 10, @CompileTimeConstant = true, @DoubleLiteral = false, @FloatLiteral = false, @Image = "1", @IntLiteral = true, @Integral = true, @LiteralText = "1", @LongLiteral = false, @ParenthesisDepth = 0, @Parenthesized = false, @ValueAsDouble = 1.0, @ValueAsFloat = 1.0, @ValueAsInt = 1, @ValueAsLong = 1] + +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "method2", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] + +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] + +- VoidType[] + +- FormalParameters[@Empty = false, @Size = 1] + | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] + | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] + | +- PrimitiveType[@Kind = PrimitiveTypeKind.INT] + | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "_", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] + +- Block[@Empty = true, @Size = 0, @containsComment = false] From fe8920a4fc3ee0f0b58931f279bec69a577dd5db Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 10:25:06 +0200 Subject: [PATCH 095/121] [doc] Update release notes (#4954, #5028, #5004) --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..b2390770d7 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -41,6 +41,8 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources + * [#4954](https://github.com/pmd/pmd/issues/4954): \[java] LocalVariableNamingConventions should allow unnamed variables by default + * [#5028](https://github.com/pmd/pmd/issues/5028): \[java] FormalParameterNamingConventions should accept unnamed parameters by default ### ๐Ÿšจ API Changes From a936852ba2cdad71bd7c5194c10b46b149882fa7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 11:25:32 +0200 Subject: [PATCH 096/121] Add @cowwoc as a contributor --- .all-contributorsrc | 9 ++ docs/pages/pmd/projectdocs/credits.md | 173 +++++++++++++------------- 2 files changed, 96 insertions(+), 86 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 924c39021e..14c87d853d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7534,6 +7534,15 @@ "contributions": [ "bug" ] + }, + { + "login": "cowwoc", + "name": "Gili Tzabari", + "avatar_url": "https://avatars.githubusercontent.com/u/633348?v=4", + "profile": "https://github.com/cowwoc", + "contributions": [ + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 9855a0bacd..5c48f4e77e 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -294,780 +294,781 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Georg Romstorfer
Georg Romstorfer

๐Ÿ› + Gili Tzabari
Gili Tzabari

๐Ÿ› Gio
Gio

๐Ÿ› Gol
Gol

๐Ÿ› Gonzalo Exequiel Ibars Ingman
Gonzalo Exequiel Ibars Ingman

๐Ÿ’ป ๐Ÿ› GooDer
GooDer

๐Ÿ› Gregor Riegler
Gregor Riegler

๐Ÿ› Grzegorz Olszewski
Grzegorz Olszewski

๐Ÿ› - Gunther Schrijvers
Gunther Schrijvers

๐Ÿ’ป ๐Ÿ› + Gunther Schrijvers
Gunther Schrijvers

๐Ÿ’ป ๐Ÿ› Gustavo Krieger
Gustavo Krieger

๐Ÿ› Guy Elsmore-Paddock
Guy Elsmore-Paddock

๐Ÿ› Gรถrkem Mรผlayim
Gรถrkem Mรผlayim

๐Ÿ› Hanzel Godinez
Hanzel Godinez

๐Ÿ› Haoliang Chen
Haoliang Chen

๐Ÿ› Harsh Kukreja
Harsh Kukreja

๐Ÿ› - Hassan ALAMI
Hassan ALAMI

๐Ÿ› + Hassan ALAMI
Hassan ALAMI

๐Ÿ› Heber
Heber

๐Ÿ› Henning Schmiedehausen
Henning Schmiedehausen

๐Ÿ’ป ๐Ÿ› Henning von Bargen
Henning von Bargen

๐Ÿ’ป Hervรฉ Boutemy
Hervรฉ Boutemy

๐Ÿ› Himanshu Pandey
Himanshu Pandey

๐Ÿ› Hokwang Lee
Hokwang Lee

๐Ÿ› - Hooperbloob
Hooperbloob

๐Ÿ’ป + Hooperbloob
Hooperbloob

๐Ÿ’ป Hung PHAN
Hung PHAN

๐Ÿ› IDoCodingStuffs
IDoCodingStuffs

๐Ÿ’ป ๐Ÿ› Iccen Gan
Iccen Gan

๐Ÿ› Ignacio Mariano Tirabasso
Ignacio Mariano Tirabasso

๐Ÿ› Igor Melnichenko
Igor Melnichenko

๐Ÿ› Igor Moreno
Igor Moreno

๐Ÿ› - Intelesis-MS
Intelesis-MS

๐Ÿ› + Intelesis-MS
Intelesis-MS

๐Ÿ› Iroha_
Iroha_

๐Ÿ› Ishan Srivastava
Ishan Srivastava

๐Ÿ› Ivan Vakhrushev
Ivan Vakhrushev

๐Ÿ› Ivano Guerini
Ivano Guerini

๐Ÿ› Ivar Andreas Bonsaksen
Ivar Andreas Bonsaksen

๐Ÿ› Ivo ล mรญd
Ivo ล mรญd

๐Ÿ› - JJengility
JJengility

๐Ÿ› + JJengility
JJengility

๐Ÿ› Jake Hemmerle
Jake Hemmerle

๐Ÿ› James Harrison
James Harrison

๐Ÿ› ๐Ÿ’ป Jan
Jan

๐Ÿ› Jan Aertgeerts
Jan Aertgeerts

๐Ÿ’ป ๐Ÿ› Jan Brรผmmer
Jan Brรผmmer

๐Ÿ› Jan Tล™รญska
Jan Tล™รญska

๐Ÿ› - Jan-Lukas Else
Jan-Lukas Else

๐Ÿ› + Jan-Lukas Else
Jan-Lukas Else

๐Ÿ› Jason Qiu
Jason Qiu

๐Ÿ’ป ๐Ÿ“– Jason Williams
Jason Williams

๐Ÿ› Jean-Paul Mayer
Jean-Paul Mayer

๐Ÿ› Jean-Simon Larochelle
Jean-Simon Larochelle

๐Ÿ› Jeff Bartolotta
Jeff Bartolotta

๐Ÿ’ป ๐Ÿ› Jeff Hube
Jeff Hube

๐Ÿ’ป ๐Ÿ› - Jeff Jensen
Jeff Jensen

๐Ÿ› + Jeff Jensen
Jeff Jensen

๐Ÿ› Jeff May
Jeff May

๐Ÿ› Jens Gerdes
Jens Gerdes

๐Ÿ› Jeroen Borgers
Jeroen Borgers

๐Ÿ› ๐Ÿ’ป ๐Ÿ“ข Jeroen van Wilgenburg
Jeroen van Wilgenburg

๐Ÿ“– Jerome Russ
Jerome Russ

๐Ÿ› JerritEic
JerritEic

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› - Jiri Pejchal
Jiri Pejchal

๐Ÿ› + Jiri Pejchal
Jiri Pejchal

๐Ÿ› Jithin Sunny
Jithin Sunny

๐Ÿ› Jiล™รญ ล korpil
Jiล™รญ ล korpil

๐Ÿ› Joao Machado
Joao Machado

๐Ÿ› Jochen Krauss
Jochen Krauss

๐Ÿ› Johan Hammar
Johan Hammar

๐Ÿ› John Karp
John Karp

๐Ÿ› - John Zhang
John Zhang

๐Ÿ› + John Zhang
John Zhang

๐Ÿ› John-Teng
John-Teng

๐Ÿ’ป ๐Ÿ› Jon Moroney
Jon Moroney

๐Ÿ’ป ๐Ÿ› Jonas Geiregat
Jonas Geiregat

๐Ÿ› Jonathan Wiesel
Jonathan Wiesel

๐Ÿ’ป ๐Ÿ› Jordan
Jordan

๐Ÿ› Jordi Llach
Jordi Llach

๐Ÿ› - Jorge Solรณrzano
Jorge Solรณrzano

๐Ÿ› + Jorge Solรณrzano
Jorge Solรณrzano

๐Ÿ› JorneVL
JorneVL

๐Ÿ› Jose Palafox
Jose Palafox

๐Ÿ› Jose Stovall
Jose Stovall

๐Ÿ› Joseph
Joseph

๐Ÿ’ป Joseph Heenan
Joseph Heenan

๐Ÿ› Josh Feingold
Josh Feingold

๐Ÿ’ป ๐Ÿ› - Josh Holthaus
Josh Holthaus

๐Ÿ› + Josh Holthaus
Josh Holthaus

๐Ÿ› Joshua S Arquilevich
Joshua S Arquilevich

๐Ÿ› Joรฃo Dinis Ferreira
Joรฃo Dinis Ferreira

๐Ÿ“– Joรฃo Ferreira
Joรฃo Ferreira

๐Ÿ’ป ๐Ÿ› Joรฃo Pedro Schmitt
Joรฃo Pedro Schmitt

๐Ÿ› Juan Martรญn Sotuyo Dodero
Juan Martรญn Sotuyo Dodero

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง Juan Pablo Civile
Juan Pablo Civile

๐Ÿ› - Julian Voronetsky
Julian Voronetsky

๐Ÿ› + Julian Voronetsky
Julian Voronetsky

๐Ÿ› Julien
Julien

๐Ÿ› Julius
Julius

๐Ÿ› JustPRV
JustPRV

๐Ÿ› Jรถrn Huxhorn
Jรถrn Huxhorn

๐Ÿ› KThompso
KThompso

๐Ÿ› Kai Amundsen
Kai Amundsen

๐Ÿ› - Karel Vervaeke
Karel Vervaeke

๐Ÿ› + Karel Vervaeke
Karel Vervaeke

๐Ÿ› Karl-Andero Mere
Karl-Andero Mere

๐Ÿ› Karl-Philipp Richter
Karl-Philipp Richter

๐Ÿ› Karsten Silz
Karsten Silz

๐Ÿ› Kazuma Watanabe
Kazuma Watanabe

๐Ÿ› Kev
Kev

๐Ÿ› Keve Mรผller
Keve Mรผller

๐Ÿ› - Kevin Guerra
Kevin Guerra

๐Ÿ’ป + Kevin Guerra
Kevin Guerra

๐Ÿ’ป Kevin Jones
Kevin Jones

๐Ÿ› ๐Ÿ’ป Kevin Wayne
Kevin Wayne

๐Ÿ› Kieran Black
Kieran Black

๐Ÿ› Kirill Zubov
Kirill Zubov

๐Ÿ› Kirk Clemens
Kirk Clemens

๐Ÿ’ป ๐Ÿ› Klaus Hartl
Klaus Hartl

๐Ÿ› - Koen Van Looveren
Koen Van Looveren

๐Ÿ› + Koen Van Looveren
Koen Van Looveren

๐Ÿ› Kris Scheibe
Kris Scheibe

๐Ÿ’ป ๐Ÿ› Krystian Dabrowski
Krystian Dabrowski

๐Ÿ› ๐Ÿ’ป Kunal Thanki
Kunal Thanki

๐Ÿ› LaLucid
LaLucid

๐Ÿ’ป Larry Diamond
Larry Diamond

๐Ÿ’ป ๐Ÿ› Lars Knickrehm
Lars Knickrehm

๐Ÿ› - Laurent Bovet
Laurent Bovet

๐Ÿ› ๐Ÿ’ป + Laurent Bovet
Laurent Bovet

๐Ÿ› ๐Ÿ’ป Leo Gutierrez
Leo Gutierrez

๐Ÿ› LiGaOg
LiGaOg

๐Ÿ’ป Liam Sharp
Liam Sharp

๐Ÿ› Lintsi
Lintsi

๐Ÿ› Linus Fernandes
Linus Fernandes

๐Ÿ› Lixon Lookose
Lixon Lookose

๐Ÿ› - Logesh
Logesh

๐Ÿ› + Logesh
Logesh

๐Ÿ› Lorenzo Gabriele
Lorenzo Gabriele

๐Ÿ› Loรฏc Ledoyen
Loรฏc Ledoyen

๐Ÿ› Lucas
Lucas

๐Ÿ› Lucas Silva
Lucas Silva

๐Ÿ› Lucas Soncini
Lucas Soncini

๐Ÿ’ป ๐Ÿ› Luis Alcantar
Luis Alcantar

๐Ÿ’ป - Lukasz Slonina
Lukasz Slonina

๐Ÿ› + Lukasz Slonina
Lukasz Slonina

๐Ÿ› Lukebray
Lukebray

๐Ÿ› Lynn
Lynn

๐Ÿ’ป ๐Ÿ› Lyor Goldstein
Lyor Goldstein

๐Ÿ› MCMicS
MCMicS

๐Ÿ› Macarse
Macarse

๐Ÿ› Machine account for PMD
Machine account for PMD

๐Ÿ’ป - Maciek Siemczyk
Maciek Siemczyk

๐Ÿ› + Maciek Siemczyk
Maciek Siemczyk

๐Ÿ› Maikel Steneker
Maikel Steneker

๐Ÿ’ป ๐Ÿ› Maksim Moiseikin
Maksim Moiseikin

๐Ÿ› Manfred Koch
Manfred Koch

๐Ÿ› Manuel Moya Ferrer
Manuel Moya Ferrer

๐Ÿ’ป ๐Ÿ› Manuel Ryan
Manuel Ryan

๐Ÿ› Marat Vyshegorodtsev
Marat Vyshegorodtsev

๐Ÿ› - Marcel Hรคrle
Marcel Hรคrle

๐Ÿ› + Marcel Hรคrle
Marcel Hรคrle

๐Ÿ› Marcello Fialho
Marcello Fialho

๐Ÿ› Marcin Dฤ…browski
Marcin Dฤ…browski

๐Ÿ’ป Marcin Rataj
Marcin Rataj

๐Ÿ› Marcono1234
Marcono1234

๐Ÿ› Mark Adamcin
Mark Adamcin

๐Ÿ› Mark Hall
Mark Hall

๐Ÿ’ป ๐Ÿ› - Mark Kolich
Mark Kolich

๐Ÿ› + Mark Kolich
Mark Kolich

๐Ÿ› Mark Pritchard
Mark Pritchard

๐Ÿ› Markus Rathgeb
Markus Rathgeb

๐Ÿ› Marquis Wang
Marquis Wang

๐Ÿ› MartGit
MartGit

๐Ÿ› Martin Feldsztejn
Martin Feldsztejn

๐Ÿ› Martin Lehmann
Martin Lehmann

๐Ÿ› - Martin Spamer
Martin Spamer

๐Ÿ› + Martin Spamer
Martin Spamer

๐Ÿ› Martin Tarjรกnyi
Martin Tarjรกnyi

๐Ÿ› MatFl
MatFl

๐Ÿ› Mateusz Stefanski
Mateusz Stefanski

๐Ÿ› Mathieu Gouin
Mathieu Gouin

๐Ÿ› MatiasComercio
MatiasComercio

๐Ÿ’ป ๐Ÿ› Matt Benson
Matt Benson

๐Ÿ› - Matt De Poorter
Matt De Poorter

๐Ÿ› + Matt De Poorter
Matt De Poorter

๐Ÿ› Matt Hargett
Matt Hargett

๐Ÿ’ป ๐Ÿ’ต Matt Harrah
Matt Harrah

๐Ÿ› Matt Nelson
Matt Nelson

๐Ÿ› Matthew Amos
Matthew Amos

๐Ÿ› Matthew Duggan
Matthew Duggan

๐Ÿ› Matthew Hall
Matthew Hall

๐Ÿ› - Matรญas Fraga
Matรญas Fraga

๐Ÿ’ป ๐Ÿ› + Matรญas Fraga
Matรญas Fraga

๐Ÿ’ป ๐Ÿ› Maxime Robert
Maxime Robert

๐Ÿ’ป ๐Ÿ› MetaBF
MetaBF

๐Ÿ› Michael
Michael

๐Ÿ› Michael Bell
Michael Bell

๐Ÿ› Michael Bernstein
Michael Bernstein

๐Ÿ› Michael Clay
Michael Clay

๐Ÿ› - Michael Dombrowski
Michael Dombrowski

๐Ÿ› + Michael Dombrowski
Michael Dombrowski

๐Ÿ› Michael Hausegger
Michael Hausegger

๐Ÿ› Michael Hoefer
Michael Hoefer

๐Ÿ› Michael Kolesnikov
Michael Kolesnikov

๐Ÿ› Michael Mรถbius
Michael Mรถbius

๐Ÿ› Michael N. Lipp
Michael N. Lipp

๐Ÿ› Michael Pellegrini
Michael Pellegrini

๐Ÿ› - Michal Kordas
Michal Kordas

๐Ÿ› + Michal Kordas
Michal Kordas

๐Ÿ› Michaล‚ Borek
Michaล‚ Borek

๐Ÿ› Michaล‚ Kuliล„ski
Michaล‚ Kuliล„ski

๐Ÿ› Miguel Nรบรฑez Dรญaz-Montes
Miguel Nรบรฑez Dรญaz-Montes

๐Ÿ› Mihai Ionut
Mihai Ionut

๐Ÿ› Mikhail Kuchma
Mikhail Kuchma

๐Ÿ› Mirek Hankus
Mirek Hankus

๐Ÿ› - Mitch Spano
Mitch Spano

๐Ÿ› + Mitch Spano
Mitch Spano

๐Ÿ› Mladjan Gadzic
Mladjan Gadzic

๐Ÿ› MrAngry52
MrAngry52

๐Ÿ› Muminur Choudhury
Muminur Choudhury

๐Ÿ› Mykhailo Palahuta
Mykhailo Palahuta

๐Ÿ’ป ๐Ÿ› Nagendra Kumar Singh
Nagendra Kumar Singh

๐Ÿ› Nahuel Barrios
Nahuel Barrios

๐Ÿ› - Nakul Sharma
Nakul Sharma

๐Ÿ› + Nakul Sharma
Nakul Sharma

๐Ÿ› Nathan Braun
Nathan Braun

๐Ÿ› Nathan Reynolds
Nathan Reynolds

๐Ÿ› Nathan Reynolds
Nathan Reynolds

๐Ÿ› Nathanaรซl
Nathanaรซl

๐Ÿ› Naveen
Naveen

๐Ÿ’ป Nazdravi
Nazdravi

๐Ÿ› - Neha-Dhonde
Neha-Dhonde

๐Ÿ› + Neha-Dhonde
Neha-Dhonde

๐Ÿ› Nicholas Doyle
Nicholas Doyle

๐Ÿ› Nick Butcher
Nick Butcher

๐Ÿ› Nico Gallinal
Nico Gallinal

๐Ÿ› Nicola Dal Maso
Nicola Dal Maso

๐Ÿ› Nicolas Filotto
Nicolas Filotto

๐Ÿ’ป Nicolas Vervelle
Nicolas Vervelle

๐Ÿ› - Nicolas Vuillamy
Nicolas Vuillamy

๐Ÿ“– + Nicolas Vuillamy
Nicolas Vuillamy

๐Ÿ“– Nikita Chursin
Nikita Chursin

๐Ÿ› Niklas Baudy
Niklas Baudy

๐Ÿ› Nikolas Havrikov
Nikolas Havrikov

๐Ÿ› Nilesh Virkar
Nilesh Virkar

๐Ÿ› Nimit Patel
Nimit Patel

๐Ÿ› Niranjan Harpale
Niranjan Harpale

๐Ÿ› - Nirvik Patel
Nirvik Patel

๐Ÿ’ป + Nirvik Patel
Nirvik Patel

๐Ÿ’ป Noah Sussman
Noah Sussman

๐Ÿ› Noah0120
Noah0120

๐Ÿ› Noam Tamim
Noam Tamim

๐Ÿ› Noel Grandin
Noel Grandin

๐Ÿ› Olaf Haalstra
Olaf Haalstra

๐Ÿ› Oleg Andreych
Oleg Andreych

๐Ÿ’ป ๐Ÿ› - Oleg Pavlenko
Oleg Pavlenko

๐Ÿ› + Oleg Pavlenko
Oleg Pavlenko

๐Ÿ› Oleksii Dykov
Oleksii Dykov

๐Ÿ’ป ๐Ÿ› Oliver Eikemeier
Oliver Eikemeier

๐Ÿ› Oliver Siegmar
Oliver Siegmar

๐Ÿ’ต Olivier Parent
Olivier Parent

๐Ÿ’ป ๐Ÿ› Ollie Abbey
Ollie Abbey

๐Ÿ’ป ๐Ÿ› OverDrone
OverDrone

๐Ÿ› - Ozan Gulle
Ozan Gulle

๐Ÿ’ป ๐Ÿ› + Ozan Gulle
Ozan Gulle

๐Ÿ’ป ๐Ÿ› PUNEET JAIN
PUNEET JAIN

๐Ÿ› Parbati Bose
Parbati Bose

๐Ÿ› Paul Berg
Paul Berg

๐Ÿ› Paul Guyot
Paul Guyot

๐Ÿ’ป Pavel Bludov
Pavel Bludov

๐Ÿ› Pavel Miฤka
Pavel Miฤka

๐Ÿ› - Pedro Nuno Santos
Pedro Nuno Santos

๐Ÿ› + Pedro Nuno Santos
Pedro Nuno Santos

๐Ÿ› Pedro Rijo
Pedro Rijo

๐Ÿ› Pelisse Romain
Pelisse Romain

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› Per Abich
Per Abich

๐Ÿ’ป Pete Davids
Pete Davids

๐Ÿ› Peter Bruin
Peter Bruin

๐Ÿ› Peter Chittum
Peter Chittum

๐Ÿ’ป ๐Ÿ› - Peter Cudmore
Peter Cudmore

๐Ÿ› + Peter Cudmore
Peter Cudmore

๐Ÿ› Peter Kasson
Peter Kasson

๐Ÿ› Peter Kofler
Peter Kofler

๐Ÿ› Peter Paul Bakker
Peter Paul Bakker

๐Ÿ’ป Peter Rader
Peter Rader

๐Ÿ› Pham Hai Trung
Pham Hai Trung

๐Ÿ› Philip Graf
Philip Graf

๐Ÿ’ป ๐Ÿ› - Philip Hachey
Philip Hachey

๐Ÿ› + Philip Hachey
Philip Hachey

๐Ÿ› Philippe Ozil
Philippe Ozil

๐Ÿ› Phinehas Artemix
Phinehas Artemix

๐Ÿ› Phokham Nonava
Phokham Nonava

๐Ÿ› Pim van der Loos
Pim van der Loos

๐Ÿ’ป โš ๏ธ Piotr Szymaล„ski
Piotr Szymaล„ski

๐Ÿ› Piotrek ลปygieล‚o
Piotrek ลปygieล‚o

๐Ÿ’ป ๐Ÿ› ๐Ÿ“– - Pranay Jaiswal
Pranay Jaiswal

๐Ÿ› + Pranay Jaiswal
Pranay Jaiswal

๐Ÿ› Prasad Kamath
Prasad Kamath

๐Ÿ› Prasanna
Prasanna

๐Ÿ› Presh-AR
Presh-AR

๐Ÿ› Puneet1726
Puneet1726

๐Ÿ› Rafael Cortรชs
Rafael Cortรชs

๐Ÿ› RaheemShaik999
RaheemShaik999

๐Ÿ› - RajeshR
RajeshR

๐Ÿ’ป ๐Ÿ› + RajeshR
RajeshR

๐Ÿ’ป ๐Ÿ› Ramachandra Mohan
Ramachandra Mohan

๐Ÿ› Ramel0921
Ramel0921

๐Ÿ› Raquel Pau
Raquel Pau

๐Ÿ› Ravikiran Janardhana
Ravikiran Janardhana

๐Ÿ› Reda Benhemmouche
Reda Benhemmouche

๐Ÿ› Reinhard Schiedermeier
Reinhard Schiedermeier

๐Ÿ› - Renato Oliveira
Renato Oliveira

๐Ÿ’ป ๐Ÿ› + Renato Oliveira
Renato Oliveira

๐Ÿ’ป ๐Ÿ› Rich DiCroce
Rich DiCroce

๐Ÿ› Richard Corfield
Richard Corfield

๐Ÿ’ป Richard Corfield
Richard Corfield

๐Ÿ› ๐Ÿ’ป Riot R1cket
Riot R1cket

๐Ÿ› Rishabh Jain
Rishabh Jain

๐Ÿ› RishabhDeep Singh
RishabhDeep Singh

๐Ÿ› - Robbie Martinus
Robbie Martinus

๐Ÿ’ป ๐Ÿ› + Robbie Martinus
Robbie Martinus

๐Ÿ’ป ๐Ÿ› Robert Henry
Robert Henry

๐Ÿ› Robert Mihaly
Robert Mihaly

๐Ÿ› Robert Painsi
Robert Painsi

๐Ÿ› Robert Russell
Robert Russell

๐Ÿ› Robert Sรถsemann
Robert Sรถsemann

๐Ÿ’ป ๐Ÿ“– ๐Ÿ“ข ๐Ÿ› Robert Whitebit
Robert Whitebit

๐Ÿ› - Robin Richtsfeld
Robin Richtsfeld

๐Ÿ› + Robin Richtsfeld
Robin Richtsfeld

๐Ÿ› Robin Stocker
Robin Stocker

๐Ÿ’ป ๐Ÿ› Robin Wils
Robin Wils

๐Ÿ› RochusOest
RochusOest

๐Ÿ› Rodolfo Noviski
Rodolfo Noviski

๐Ÿ› Rodrigo Casara
Rodrigo Casara

๐Ÿ› Rodrigo Fernandes
Rodrigo Fernandes

๐Ÿ› - Roman Salvador
Roman Salvador

๐Ÿ’ป ๐Ÿ› + Roman Salvador
Roman Salvador

๐Ÿ’ป ๐Ÿ› Ronald Blaschke
Ronald Blaschke

๐Ÿ› Rรณbert Papp
Rรณbert Papp

๐Ÿ› Saikat Sengupta
Saikat Sengupta

๐Ÿ› Saksham Handu
Saksham Handu

๐Ÿ› Saladoc
Saladoc

๐Ÿ› Salesforce Bob Lightning
Salesforce Bob Lightning

๐Ÿ› - Sam Carlberg
Sam Carlberg

๐Ÿ› + Sam Carlberg
Sam Carlberg

๐Ÿ› Sashko
Sashko

๐Ÿ’ป Satoshi Kubo
Satoshi Kubo

๐Ÿ› Scott Kennedy
Scott Kennedy

๐Ÿ› Scott Wells
Scott Wells

๐Ÿ› ๐Ÿ’ป Scrates1
Scrates1

๐Ÿ› ๐Ÿ’ป Scrsloota
Scrsloota

๐Ÿ’ป - Sebastian Bรถgl
Sebastian Bรถgl

๐Ÿ› + Sebastian Bรถgl
Sebastian Bรถgl

๐Ÿ› Sebastian Davids
Sebastian Davids

๐Ÿ› Sebastian Schuberth
Sebastian Schuberth

๐Ÿ› Sebastian Schwarz
Sebastian Schwarz

๐Ÿ› Seren
Seren

๐Ÿ› ๐Ÿ’ป Sergey Gorbaty
Sergey Gorbaty

๐Ÿ› Sergey Kozlov
Sergey Kozlov

๐Ÿ› - Sergey Yanzin
Sergey Yanzin

๐Ÿ’ป ๐Ÿ› + Sergey Yanzin
Sergey Yanzin

๐Ÿ’ป ๐Ÿ› Seth Wilcox
Seth Wilcox

๐Ÿ’ป Shai Bennathan
Shai Bennathan

๐Ÿ› ๐Ÿ’ป Shubham
Shubham

๐Ÿ’ป ๐Ÿ› Simon Abykov
Simon Abykov

๐Ÿ’ป ๐Ÿ› Simon Xiao
Simon Xiao

๐Ÿ› Srinivasan Venkatachalam
Srinivasan Venkatachalam

๐Ÿ› - Stanislav Gromov
Stanislav Gromov

๐Ÿ› + Stanislav Gromov
Stanislav Gromov

๐Ÿ› Stanislav Myachenkov
Stanislav Myachenkov

๐Ÿ’ป Stefan Birkner
Stefan Birkner

๐Ÿ› Stefan Bohn
Stefan Bohn

๐Ÿ› Stefan Endrullis
Stefan Endrullis

๐Ÿ› Stefan Klรถss-Schuster
Stefan Klรถss-Schuster

๐Ÿ› Stefan Wolf
Stefan Wolf

๐Ÿ› - Stephan H. Wissel
Stephan H. Wissel

๐Ÿ› + Stephan H. Wissel
Stephan H. Wissel

๐Ÿ› Stephen
Stephen

๐Ÿ› Stephen Friedrich
Stephen Friedrich

๐Ÿ› Steve Babula
Steve Babula

๐Ÿ’ป Steven Stearns
Steven Stearns

๐Ÿ› ๐Ÿ’ป Stexxe
Stexxe

๐Ÿ› Stian Lรฅgstad
Stian Lรฅgstad

๐Ÿ› - StuartClayton5
StuartClayton5

๐Ÿ› + StuartClayton5
StuartClayton5

๐Ÿ› Supun Arunoda
Supun Arunoda

๐Ÿ› Suren Abrahamyan
Suren Abrahamyan

๐Ÿ› Suvashri
Suvashri

๐Ÿ“– SwatiBGupta1110
SwatiBGupta1110

๐Ÿ› SyedThoufich
SyedThoufich

๐Ÿ› Szymon Sasin
Szymon Sasin

๐Ÿ› - T-chuangxin
T-chuangxin

๐Ÿ› + T-chuangxin
T-chuangxin

๐Ÿ› TERAI Atsuhiro
TERAI Atsuhiro

๐Ÿ› TIOBE Software
TIOBE Software

๐Ÿ’ป ๐Ÿ› Tarush Singh
Tarush Singh

๐Ÿ’ป Taylor Smock
Taylor Smock

๐Ÿ› Techeira Damiรกn
Techeira Damiรกn

๐Ÿ’ป ๐Ÿ› Ted Husted
Ted Husted

๐Ÿ› - TehBakker
TehBakker

๐Ÿ› + TehBakker
TehBakker

๐Ÿ› The Gitter Badger
The Gitter Badger

๐Ÿ› Theodoor
Theodoor

๐Ÿ› Thiago Henrique Hรผpner
Thiago Henrique Hรผpner

๐Ÿ› Thibault Meyer
Thibault Meyer

๐Ÿ› Thomas Gรผttler
Thomas Gรผttler

๐Ÿ› Thomas Jones-Low
Thomas Jones-Low

๐Ÿ› - Thomas Smith
Thomas Smith

๐Ÿ’ป ๐Ÿ› + Thomas Smith
Thomas Smith

๐Ÿ’ป ๐Ÿ› ThrawnCA
ThrawnCA

๐Ÿ› Thu Vo
Thu Vo

๐Ÿ› Thunderforge
Thunderforge

๐Ÿ’ป ๐Ÿ› Tim van der Lippe
Tim van der Lippe

๐Ÿ› Tobias Weimer
Tobias Weimer

๐Ÿ’ป ๐Ÿ› Tom Copeland
Tom Copeland

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– - Tom Daly
Tom Daly

๐Ÿ› + Tom Daly
Tom Daly

๐Ÿ› Tomer Figenblat
Tomer Figenblat

๐Ÿ› Tomi De Lucca
Tomi De Lucca

๐Ÿ’ป ๐Ÿ› Torsten Kleiber
Torsten Kleiber

๐Ÿ› TrackerSB
TrackerSB

๐Ÿ› Tyson Stewart
Tyson Stewart

๐Ÿ› Ullrich Hafner
Ullrich Hafner

๐Ÿ› - Utku Cuhadaroglu
Utku Cuhadaroglu

๐Ÿ’ป ๐Ÿ› + Utku Cuhadaroglu
Utku Cuhadaroglu

๐Ÿ’ป ๐Ÿ› Valentin Brandl
Valentin Brandl

๐Ÿ› Valeria
Valeria

๐Ÿ› Valery Yatsynovich
Valery Yatsynovich

๐Ÿ“– Vasily Anisimov
Vasily Anisimov

๐Ÿ› Vibhor Goyal
Vibhor Goyal

๐Ÿ› Vickenty Fesunov
Vickenty Fesunov

๐Ÿ› - Victor Noรซl
Victor Noรซl

๐Ÿ› + Victor Noรซl
Victor Noรซl

๐Ÿ› Vincent Galloy
Vincent Galloy

๐Ÿ’ป Vincent HUYNH
Vincent HUYNH

๐Ÿ› Vincent Maurin
Vincent Maurin

๐Ÿ› Vincent Privat
Vincent Privat

๐Ÿ› Vishhwas
Vishhwas

๐Ÿ› Vishv_Android
Vishv_Android

๐Ÿ› - Vitaly
Vitaly

๐Ÿ› + Vitaly
Vitaly

๐Ÿ› Vitaly Polonetsky
Vitaly Polonetsky

๐Ÿ› Vojtech Polivka
Vojtech Polivka

๐Ÿ› Vsevolod Zholobov
Vsevolod Zholobov

๐Ÿ› Vyom Yadav
Vyom Yadav

๐Ÿ’ป Wang Shidong
Wang Shidong

๐Ÿ› Waqas Ahmed
Waqas Ahmed

๐Ÿ› - Wayne J. Earl
Wayne J. Earl

๐Ÿ› + Wayne J. Earl
Wayne J. Earl

๐Ÿ› Wchenghui
Wchenghui

๐Ÿ› Wener
Wener

๐Ÿ’ป Will Winder
Will Winder

๐Ÿ› William Brockhus
William Brockhus

๐Ÿ’ป ๐Ÿ› Wilson Kurniawan
Wilson Kurniawan

๐Ÿ› Wim Deblauwe
Wim Deblauwe

๐Ÿ› - Woongsik Choi
Woongsik Choi

๐Ÿ› + Woongsik Choi
Woongsik Choi

๐Ÿ› XenoAmess
XenoAmess

๐Ÿ’ป ๐Ÿ› Yang
Yang

๐Ÿ’ป YaroslavTER
YaroslavTER

๐Ÿ› Yasar Shaikh
Yasar Shaikh

๐Ÿ’ป Young Chan
Young Chan

๐Ÿ’ป ๐Ÿ› YuJin Kim
YuJin Kim

๐Ÿ› - Yuri Dolzhenko
Yuri Dolzhenko

๐Ÿ› + Yuri Dolzhenko
Yuri Dolzhenko

๐Ÿ› Yurii Dubinka
Yurii Dubinka

๐Ÿ› Zoltan Farkas
Zoltan Farkas

๐Ÿ› Zustin
Zustin

๐Ÿ› aaronhurst-google
aaronhurst-google

๐Ÿ› ๐Ÿ’ป alexmodis
alexmodis

๐Ÿ› andreoss
andreoss

๐Ÿ› - andrey81inmd
andrey81inmd

๐Ÿ’ป ๐Ÿ› + andrey81inmd
andrey81inmd

๐Ÿ’ป ๐Ÿ› anicoara
anicoara

๐Ÿ› arunprasathav
arunprasathav

๐Ÿ› asiercamara
asiercamara

๐Ÿ› astillich-igniti
astillich-igniti

๐Ÿ’ป avesolovksyy
avesolovksyy

๐Ÿ› avishvat
avishvat

๐Ÿ› - avivmu
avivmu

๐Ÿ› + avivmu
avivmu

๐Ÿ› axelbarfod1
axelbarfod1

๐Ÿ› b-3-n
b-3-n

๐Ÿ› balbhadra9
balbhadra9

๐Ÿ› base23de
base23de

๐Ÿ› bergander
bergander

๐Ÿ› ๐Ÿ’ป berkam
berkam

๐Ÿ’ป ๐Ÿ› - breizh31
breizh31

๐Ÿ› + breizh31
breizh31

๐Ÿ› caesarkim
caesarkim

๐Ÿ› carolyujing
carolyujing

๐Ÿ› cbfiddle
cbfiddle

๐Ÿ› cesares-basilico
cesares-basilico

๐Ÿ› chrite
chrite

๐Ÿ› ciufudean
ciufudean

๐Ÿ“– - cobratbq
cobratbq

๐Ÿ› + cobratbq
cobratbq

๐Ÿ› coladict
coladict

๐Ÿ› cosmoJFH
cosmoJFH

๐Ÿ› cristalp
cristalp

๐Ÿ› crunsk
crunsk

๐Ÿ› cwholmes
cwholmes

๐Ÿ› cyberjj999
cyberjj999

๐Ÿ› - cyw3
cyw3

๐Ÿ› ๐Ÿ“– + cyw3
cyw3

๐Ÿ› ๐Ÿ“– d1ss0nanz
d1ss0nanz

๐Ÿ› dague1
dague1

๐Ÿ“– dalizi007
dalizi007

๐Ÿ’ป danbrycefairsailcom
danbrycefairsailcom

๐Ÿ› dariansanity
dariansanity

๐Ÿ› darrenmiliband
darrenmiliband

๐Ÿ› - davidburstrom
davidburstrom

๐Ÿ› + davidburstrom
davidburstrom

๐Ÿ› dbirkman-paloalto
dbirkman-paloalto

๐Ÿ› deepak-patra
deepak-patra

๐Ÿ› dependabot[bot]
dependabot[bot]

๐Ÿ’ป ๐Ÿ› dinesh150
dinesh150

๐Ÿ› diziaq
diziaq

๐Ÿ› dreaminpast123
dreaminpast123

๐Ÿ› - duanyanan
duanyanan

๐Ÿ› + duanyanan
duanyanan

๐Ÿ› dutt-sanjay
dutt-sanjay

๐Ÿ› dylanleung
dylanleung

๐Ÿ› dzeigler
dzeigler

๐Ÿ› eant60
eant60

๐Ÿ› ekkirala
ekkirala

๐Ÿ› emersonmoura
emersonmoura

๐Ÿ› - emouty
emouty

๐Ÿ’ป + emouty
emouty

๐Ÿ’ป eugenepugach
eugenepugach

๐Ÿ› fairy
fairy

๐Ÿ› filiprafalowicz
filiprafalowicz

๐Ÿ’ป flxbl-io
flxbl-io

๐Ÿ’ต foxmason
foxmason

๐Ÿ› frankegabor
frankegabor

๐Ÿ› - frankl
frankl

๐Ÿ› + frankl
frankl

๐Ÿ› freafrea
freafrea

๐Ÿ› fsapatin
fsapatin

๐Ÿ› gracia19
gracia19

๐Ÿ› guo fei
guo fei

๐Ÿ› gurmsc5
gurmsc5

๐Ÿ› gwilymatgearset
gwilymatgearset

๐Ÿ’ป ๐Ÿ› - haigsn
haigsn

๐Ÿ› + haigsn
haigsn

๐Ÿ› hemanshu070
hemanshu070

๐Ÿ› henrik242
henrik242

๐Ÿ› hongpuwu
hongpuwu

๐Ÿ› hvbtup
hvbtup

๐Ÿ’ป ๐Ÿ› igniti GmbH
igniti GmbH

๐Ÿ› ilovezfs
ilovezfs

๐Ÿ› - itaigilo
itaigilo

๐Ÿ› + itaigilo
itaigilo

๐Ÿ› jakivey32
jakivey32

๐Ÿ› jbennett2091
jbennett2091

๐Ÿ› jcamerin
jcamerin

๐Ÿ› jkeener1
jkeener1

๐Ÿ› jmetertea
jmetertea

๐Ÿ› johnra2
johnra2

๐Ÿ’ป - josemanuelrolon
josemanuelrolon

๐Ÿ’ป ๐Ÿ› + josemanuelrolon
josemanuelrolon

๐Ÿ’ป ๐Ÿ› kabroxiko
kabroxiko

๐Ÿ’ป ๐Ÿ› karwer
karwer

๐Ÿ› kaulonline
kaulonline

๐Ÿ› kdaemonv
kdaemonv

๐Ÿ› kdebski85
kdebski85

๐Ÿ› ๐Ÿ’ป kenji21
kenji21

๐Ÿ’ป ๐Ÿ› - kfranic
kfranic

๐Ÿ› + kfranic
kfranic

๐Ÿ› khalidkh
khalidkh

๐Ÿ› koalalam
koalalam

๐Ÿ› krzyk
krzyk

๐Ÿ› lasselindqvist
lasselindqvist

๐Ÿ› lgemeinhardt
lgemeinhardt

๐Ÿ› lihuaib
lihuaib

๐Ÿ› - liqingjun123
liqingjun123

๐Ÿ› + liqingjun123
liqingjun123

๐Ÿ› lonelyma1021
lonelyma1021

๐Ÿ› lpeddy
lpeddy

๐Ÿ› lujiefsi
lujiefsi

๐Ÿ’ป lukelukes
lukelukes

๐Ÿ’ป lyriccoder
lyriccoder

๐Ÿ› marcelmore
marcelmore

๐Ÿ› - matchbox
matchbox

๐Ÿ› + matchbox
matchbox

๐Ÿ› matthiaskraaz
matthiaskraaz

๐Ÿ› meandonlyme
meandonlyme

๐Ÿ› mikesive
mikesive

๐Ÿ› milossesic
milossesic

๐Ÿ› mluckam
mluckam

๐Ÿ’ป mohan-chinnappan-n
mohan-chinnappan-n

๐Ÿ’ป - mriddell95
mriddell95

๐Ÿ› + mriddell95
mriddell95

๐Ÿ› mrlzh
mrlzh

๐Ÿ› msloan
msloan

๐Ÿ› mucharlaravalika
mucharlaravalika

๐Ÿ› mvenneman
mvenneman

๐Ÿ› nareshl119
nareshl119

๐Ÿ› nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

๐Ÿ› - noerremark
noerremark

๐Ÿ› + noerremark
noerremark

๐Ÿ› novsirion
novsirion

๐Ÿ› nwcm
nwcm

๐Ÿ“– ๐Ÿ› ๐Ÿ’ป oggboy
oggboy

๐Ÿ› oinume
oinume

๐Ÿ› orimarko
orimarko

๐Ÿ’ป ๐Ÿ› pacvz
pacvz

๐Ÿ’ป - pallavi agarwal
pallavi agarwal

๐Ÿ› + pallavi agarwal
pallavi agarwal

๐Ÿ› parksungrin
parksungrin

๐Ÿ› patpatpat123
patpatpat123

๐Ÿ› patriksevallius
patriksevallius

๐Ÿ› pbrajesh1
pbrajesh1

๐Ÿ› phoenix384
phoenix384

๐Ÿ› piotrszymanski-sc
piotrszymanski-sc

๐Ÿ’ป - plan3d
plan3d

๐Ÿ› + plan3d
plan3d

๐Ÿ› poojasix
poojasix

๐Ÿ› prabhushrikant
prabhushrikant

๐Ÿ› pujitha8783
pujitha8783

๐Ÿ› r-r-a-j
r-r-a-j

๐Ÿ› raghujayjunk
raghujayjunk

๐Ÿ› rajeshveera
rajeshveera

๐Ÿ› - rajeswarreddy88
rajeswarreddy88

๐Ÿ› + rajeswarreddy88
rajeswarreddy88

๐Ÿ› recdevs
recdevs

๐Ÿ› reudismam
reudismam

๐Ÿ’ป ๐Ÿ› rijkt
rijkt

๐Ÿ› rillig-tk
rillig-tk

๐Ÿ› rmohan20
rmohan20

๐Ÿ’ป ๐Ÿ› rnveach
rnveach

๐Ÿ› - rxmicro
rxmicro

๐Ÿ› + rxmicro
rxmicro

๐Ÿ› ryan-gustafson
ryan-gustafson

๐Ÿ’ป ๐Ÿ› sabi0
sabi0

๐Ÿ› scais
scais

๐Ÿ› screamingfrog
screamingfrog

๐Ÿ’ต sebbASF
sebbASF

๐Ÿ› sergeygorbaty
sergeygorbaty

๐Ÿ’ป - shilko2013
shilko2013

๐Ÿ› + shilko2013
shilko2013

๐Ÿ› shiomiyan
shiomiyan

๐Ÿ“– simeonKondr
simeonKondr

๐Ÿ› snajberk
snajberk

๐Ÿ› sniperrifle2004
sniperrifle2004

๐Ÿ› snuyanzin
snuyanzin

๐Ÿ› ๐Ÿ’ป soyodream
soyodream

๐Ÿ› - sratz
sratz

๐Ÿ› + sratz
sratz

๐Ÿ› stonio
stonio

๐Ÿ› sturton
sturton

๐Ÿ’ป ๐Ÿ› sudharmohan
sudharmohan

๐Ÿ› suruchidawar
suruchidawar

๐Ÿ› svenfinitiv
svenfinitiv

๐Ÿ› tashiscool
tashiscool

๐Ÿ› - test-git-hook
test-git-hook

๐Ÿ› + test-git-hook
test-git-hook

๐Ÿ› testation21
testation21

๐Ÿ’ป ๐Ÿ› thanosa
thanosa

๐Ÿ› tiandiyixian
tiandiyixian

๐Ÿ› tobwoerk
tobwoerk

๐Ÿ› tprouvot
tprouvot

๐Ÿ› ๐Ÿ’ป trentchilders
trentchilders

๐Ÿ› - triandicAnt
triandicAnt

๐Ÿ› + triandicAnt
triandicAnt

๐Ÿ› trishul14
trishul14

๐Ÿ› tsui
tsui

๐Ÿ› wangzitom12306
wangzitom12306

๐Ÿ› winhkey
winhkey

๐Ÿ› witherspore
witherspore

๐Ÿ› wjljack
wjljack

๐Ÿ› - wuchiuwong
wuchiuwong

๐Ÿ› + wuchiuwong
wuchiuwong

๐Ÿ› xingsong
xingsong

๐Ÿ› xioayuge
xioayuge

๐Ÿ› xnYi9wRezm
xnYi9wRezm

๐Ÿ’ป ๐Ÿ› xuanuy
xuanuy

๐Ÿ› xyf0921
xyf0921

๐Ÿ› yalechen-cyw3
yalechen-cyw3

๐Ÿ› - yasuharu-sato
yasuharu-sato

๐Ÿ› + yasuharu-sato
yasuharu-sato

๐Ÿ› zenglian
zenglian

๐Ÿ› zgrzyt93
zgrzyt93

๐Ÿ’ป ๐Ÿ› zh3ng
zh3ng

๐Ÿ› zt_soft
zt_soft

๐Ÿ› ztt79
ztt79

๐Ÿ› zzzzfeng
zzzzfeng

๐Ÿ› - รrpรกd Magosรกnyi
รrpรกd Magosรกnyi

๐Ÿ› + รrpรกd Magosรกnyi
รrpรกd Magosรกnyi

๐Ÿ› ไปป่ดตๆฐ
ไปป่ดตๆฐ

๐Ÿ› ่Œ…ๅปถๅฎ‰
่Œ…ๅปถๅฎ‰

๐Ÿ’ป From d7025a65dce1d2d9c252aed1c16f8d47ffb1607c Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 11:27:40 +0200 Subject: [PATCH 097/121] [doc] Update all-contributors - Add @bobalicious as a contributor - Update @mluckam as a contributor - Add @mdagcilar as a contributor - Add @kesslerj as a contributor - Add @Gold856 as a contributor --- .all-contributorsrc | 40 ++- docs/pages/pmd/projectdocs/credits.md | 334 +++++++++++++------------- 2 files changed, 208 insertions(+), 166 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 14c87d853d..cb5a734560 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -7071,7 +7071,8 @@ "avatar_url": "https://avatars.githubusercontent.com/u/26581168?v=4", "profile": "https://github.com/mluckam", "contributions": [ - "code" + "code", + "bug" ] }, { @@ -7543,6 +7544,43 @@ "contributions": [ "bug" ] + }, + { + "login": "bobalicious", + "name": "Rob Baillie", + "avatar_url": "https://avatars.githubusercontent.com/u/6523911?v=4", + "profile": "http://robertbaillie.blogspot.co.uk/", + "contributions": [ + "bug" + ] + }, + { + "login": "mdagcilar", + "name": "Metin Dagcilar", + "avatar_url": "https://avatars.githubusercontent.com/u/6627550?v=4", + "profile": "https://github.com/mdagcilar", + "contributions": [ + "bug" + ] + }, + { + "login": "kesslerj", + "name": "Jonas KeรŸler", + "avatar_url": "https://avatars.githubusercontent.com/u/25590499?v=4", + "profile": "https://github.com/kesslerj", + "contributions": [ + "bug" + ] + }, + { + "login": "Gold856", + "name": "Gold856", + "avatar_url": "https://avatars.githubusercontent.com/u/117957790?v=4", + "profile": "https://github.com/Gold856", + "contributions": [ + "bug", + "code" + ] } ], "contributorsPerLine": 7, diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md index 5c48f4e77e..bf7ccbd23f 100644 --- a/docs/pages/pmd/projectdocs/credits.md +++ b/docs/pages/pmd/projectdocs/credits.md @@ -297,777 +297,781 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Gili Tzabari
Gili Tzabari

๐Ÿ› Gio
Gio

๐Ÿ› Gol
Gol

๐Ÿ› + Gold856
Gold856

๐Ÿ› ๐Ÿ’ป Gonzalo Exequiel Ibars Ingman
Gonzalo Exequiel Ibars Ingman

๐Ÿ’ป ๐Ÿ› GooDer
GooDer

๐Ÿ› Gregor Riegler
Gregor Riegler

๐Ÿ› - Grzegorz Olszewski
Grzegorz Olszewski

๐Ÿ› + Grzegorz Olszewski
Grzegorz Olszewski

๐Ÿ› Gunther Schrijvers
Gunther Schrijvers

๐Ÿ’ป ๐Ÿ› Gustavo Krieger
Gustavo Krieger

๐Ÿ› Guy Elsmore-Paddock
Guy Elsmore-Paddock

๐Ÿ› Gรถrkem Mรผlayim
Gรถrkem Mรผlayim

๐Ÿ› Hanzel Godinez
Hanzel Godinez

๐Ÿ› Haoliang Chen
Haoliang Chen

๐Ÿ› - Harsh Kukreja
Harsh Kukreja

๐Ÿ› + Harsh Kukreja
Harsh Kukreja

๐Ÿ› Hassan ALAMI
Hassan ALAMI

๐Ÿ› Heber
Heber

๐Ÿ› Henning Schmiedehausen
Henning Schmiedehausen

๐Ÿ’ป ๐Ÿ› Henning von Bargen
Henning von Bargen

๐Ÿ’ป Hervรฉ Boutemy
Hervรฉ Boutemy

๐Ÿ› Himanshu Pandey
Himanshu Pandey

๐Ÿ› - Hokwang Lee
Hokwang Lee

๐Ÿ› + Hokwang Lee
Hokwang Lee

๐Ÿ› Hooperbloob
Hooperbloob

๐Ÿ’ป Hung PHAN
Hung PHAN

๐Ÿ› IDoCodingStuffs
IDoCodingStuffs

๐Ÿ’ป ๐Ÿ› Iccen Gan
Iccen Gan

๐Ÿ› Ignacio Mariano Tirabasso
Ignacio Mariano Tirabasso

๐Ÿ› Igor Melnichenko
Igor Melnichenko

๐Ÿ› - Igor Moreno
Igor Moreno

๐Ÿ› + Igor Moreno
Igor Moreno

๐Ÿ› Intelesis-MS
Intelesis-MS

๐Ÿ› Iroha_
Iroha_

๐Ÿ› Ishan Srivastava
Ishan Srivastava

๐Ÿ› Ivan Vakhrushev
Ivan Vakhrushev

๐Ÿ› Ivano Guerini
Ivano Guerini

๐Ÿ› Ivar Andreas Bonsaksen
Ivar Andreas Bonsaksen

๐Ÿ› - Ivo ล mรญd
Ivo ล mรญd

๐Ÿ› + Ivo ล mรญd
Ivo ล mรญd

๐Ÿ› JJengility
JJengility

๐Ÿ› Jake Hemmerle
Jake Hemmerle

๐Ÿ› James Harrison
James Harrison

๐Ÿ› ๐Ÿ’ป Jan
Jan

๐Ÿ› Jan Aertgeerts
Jan Aertgeerts

๐Ÿ’ป ๐Ÿ› Jan Brรผmmer
Jan Brรผmmer

๐Ÿ› - Jan Tล™รญska
Jan Tล™รญska

๐Ÿ› + Jan Tล™รญska
Jan Tล™รญska

๐Ÿ› Jan-Lukas Else
Jan-Lukas Else

๐Ÿ› Jason Qiu
Jason Qiu

๐Ÿ’ป ๐Ÿ“– Jason Williams
Jason Williams

๐Ÿ› Jean-Paul Mayer
Jean-Paul Mayer

๐Ÿ› Jean-Simon Larochelle
Jean-Simon Larochelle

๐Ÿ› Jeff Bartolotta
Jeff Bartolotta

๐Ÿ’ป ๐Ÿ› - Jeff Hube
Jeff Hube

๐Ÿ’ป ๐Ÿ› + Jeff Hube
Jeff Hube

๐Ÿ’ป ๐Ÿ› Jeff Jensen
Jeff Jensen

๐Ÿ› Jeff May
Jeff May

๐Ÿ› Jens Gerdes
Jens Gerdes

๐Ÿ› Jeroen Borgers
Jeroen Borgers

๐Ÿ› ๐Ÿ’ป ๐Ÿ“ข Jeroen van Wilgenburg
Jeroen van Wilgenburg

๐Ÿ“– Jerome Russ
Jerome Russ

๐Ÿ› - JerritEic
JerritEic

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› + JerritEic
JerritEic

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› Jiri Pejchal
Jiri Pejchal

๐Ÿ› Jithin Sunny
Jithin Sunny

๐Ÿ› Jiล™รญ ล korpil
Jiล™รญ ล korpil

๐Ÿ› Joao Machado
Joao Machado

๐Ÿ› Jochen Krauss
Jochen Krauss

๐Ÿ› Johan Hammar
Johan Hammar

๐Ÿ› - John Karp
John Karp

๐Ÿ› + John Karp
John Karp

๐Ÿ› John Zhang
John Zhang

๐Ÿ› John-Teng
John-Teng

๐Ÿ’ป ๐Ÿ› Jon Moroney
Jon Moroney

๐Ÿ’ป ๐Ÿ› Jonas Geiregat
Jonas Geiregat

๐Ÿ› + Jonas KeรŸler
Jonas KeรŸler

๐Ÿ› Jonathan Wiesel
Jonathan Wiesel

๐Ÿ’ป ๐Ÿ› - Jordan
Jordan

๐Ÿ› - Jordi Llach
Jordi Llach

๐Ÿ› + Jordan
Jordan

๐Ÿ› + Jordi Llach
Jordi Llach

๐Ÿ› Jorge Solรณrzano
Jorge Solรณrzano

๐Ÿ› JorneVL
JorneVL

๐Ÿ› Jose Palafox
Jose Palafox

๐Ÿ› Jose Stovall
Jose Stovall

๐Ÿ› Joseph
Joseph

๐Ÿ’ป - Joseph Heenan
Joseph Heenan

๐Ÿ› - Josh Feingold
Josh Feingold

๐Ÿ’ป ๐Ÿ› + Joseph Heenan
Joseph Heenan

๐Ÿ› + Josh Feingold
Josh Feingold

๐Ÿ’ป ๐Ÿ› Josh Holthaus
Josh Holthaus

๐Ÿ› Joshua S Arquilevich
Joshua S Arquilevich

๐Ÿ› Joรฃo Dinis Ferreira
Joรฃo Dinis Ferreira

๐Ÿ“– Joรฃo Ferreira
Joรฃo Ferreira

๐Ÿ’ป ๐Ÿ› Joรฃo Pedro Schmitt
Joรฃo Pedro Schmitt

๐Ÿ› - Juan Martรญn Sotuyo Dodero
Juan Martรญn Sotuyo Dodero

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง - Juan Pablo Civile
Juan Pablo Civile

๐Ÿ› + Juan Martรญn Sotuyo Dodero
Juan Martรญn Sotuyo Dodero

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› ๐Ÿšง + Juan Pablo Civile
Juan Pablo Civile

๐Ÿ› Julian Voronetsky
Julian Voronetsky

๐Ÿ› Julien
Julien

๐Ÿ› Julius
Julius

๐Ÿ› JustPRV
JustPRV

๐Ÿ› Jรถrn Huxhorn
Jรถrn Huxhorn

๐Ÿ› - KThompso
KThompso

๐Ÿ› - Kai Amundsen
Kai Amundsen

๐Ÿ› + KThompso
KThompso

๐Ÿ› + Kai Amundsen
Kai Amundsen

๐Ÿ› Karel Vervaeke
Karel Vervaeke

๐Ÿ› Karl-Andero Mere
Karl-Andero Mere

๐Ÿ› Karl-Philipp Richter
Karl-Philipp Richter

๐Ÿ› Karsten Silz
Karsten Silz

๐Ÿ› Kazuma Watanabe
Kazuma Watanabe

๐Ÿ› - Kev
Kev

๐Ÿ› - Keve Mรผller
Keve Mรผller

๐Ÿ› + Kev
Kev

๐Ÿ› + Keve Mรผller
Keve Mรผller

๐Ÿ› Kevin Guerra
Kevin Guerra

๐Ÿ’ป Kevin Jones
Kevin Jones

๐Ÿ› ๐Ÿ’ป Kevin Wayne
Kevin Wayne

๐Ÿ› Kieran Black
Kieran Black

๐Ÿ› Kirill Zubov
Kirill Zubov

๐Ÿ› - Kirk Clemens
Kirk Clemens

๐Ÿ’ป ๐Ÿ› - Klaus Hartl
Klaus Hartl

๐Ÿ› + Kirk Clemens
Kirk Clemens

๐Ÿ’ป ๐Ÿ› + Klaus Hartl
Klaus Hartl

๐Ÿ› Koen Van Looveren
Koen Van Looveren

๐Ÿ› Kris Scheibe
Kris Scheibe

๐Ÿ’ป ๐Ÿ› Krystian Dabrowski
Krystian Dabrowski

๐Ÿ› ๐Ÿ’ป Kunal Thanki
Kunal Thanki

๐Ÿ› LaLucid
LaLucid

๐Ÿ’ป - Larry Diamond
Larry Diamond

๐Ÿ’ป ๐Ÿ› - Lars Knickrehm
Lars Knickrehm

๐Ÿ› + Larry Diamond
Larry Diamond

๐Ÿ’ป ๐Ÿ› + Lars Knickrehm
Lars Knickrehm

๐Ÿ› Laurent Bovet
Laurent Bovet

๐Ÿ› ๐Ÿ’ป Leo Gutierrez
Leo Gutierrez

๐Ÿ› LiGaOg
LiGaOg

๐Ÿ’ป Liam Sharp
Liam Sharp

๐Ÿ› Lintsi
Lintsi

๐Ÿ› - Linus Fernandes
Linus Fernandes

๐Ÿ› - Lixon Lookose
Lixon Lookose

๐Ÿ› + Linus Fernandes
Linus Fernandes

๐Ÿ› + Lixon Lookose
Lixon Lookose

๐Ÿ› Logesh
Logesh

๐Ÿ› Lorenzo Gabriele
Lorenzo Gabriele

๐Ÿ› Loรฏc Ledoyen
Loรฏc Ledoyen

๐Ÿ› Lucas
Lucas

๐Ÿ› Lucas Silva
Lucas Silva

๐Ÿ› - Lucas Soncini
Lucas Soncini

๐Ÿ’ป ๐Ÿ› - Luis Alcantar
Luis Alcantar

๐Ÿ’ป + Lucas Soncini
Lucas Soncini

๐Ÿ’ป ๐Ÿ› + Luis Alcantar
Luis Alcantar

๐Ÿ’ป Lukasz Slonina
Lukasz Slonina

๐Ÿ› Lukebray
Lukebray

๐Ÿ› Lynn
Lynn

๐Ÿ’ป ๐Ÿ› Lyor Goldstein
Lyor Goldstein

๐Ÿ› MCMicS
MCMicS

๐Ÿ› - Macarse
Macarse

๐Ÿ› - Machine account for PMD
Machine account for PMD

๐Ÿ’ป + Macarse
Macarse

๐Ÿ› + Machine account for PMD
Machine account for PMD

๐Ÿ’ป Maciek Siemczyk
Maciek Siemczyk

๐Ÿ› Maikel Steneker
Maikel Steneker

๐Ÿ’ป ๐Ÿ› Maksim Moiseikin
Maksim Moiseikin

๐Ÿ› Manfred Koch
Manfred Koch

๐Ÿ› Manuel Moya Ferrer
Manuel Moya Ferrer

๐Ÿ’ป ๐Ÿ› - Manuel Ryan
Manuel Ryan

๐Ÿ› - Marat Vyshegorodtsev
Marat Vyshegorodtsev

๐Ÿ› + Manuel Ryan
Manuel Ryan

๐Ÿ› + Marat Vyshegorodtsev
Marat Vyshegorodtsev

๐Ÿ› Marcel Hรคrle
Marcel Hรคrle

๐Ÿ› Marcello Fialho
Marcello Fialho

๐Ÿ› Marcin Dฤ…browski
Marcin Dฤ…browski

๐Ÿ’ป Marcin Rataj
Marcin Rataj

๐Ÿ› Marcono1234
Marcono1234

๐Ÿ› - Mark Adamcin
Mark Adamcin

๐Ÿ› - Mark Hall
Mark Hall

๐Ÿ’ป ๐Ÿ› + Mark Adamcin
Mark Adamcin

๐Ÿ› + Mark Hall
Mark Hall

๐Ÿ’ป ๐Ÿ› Mark Kolich
Mark Kolich

๐Ÿ› Mark Pritchard
Mark Pritchard

๐Ÿ› Markus Rathgeb
Markus Rathgeb

๐Ÿ› Marquis Wang
Marquis Wang

๐Ÿ› MartGit
MartGit

๐Ÿ› - Martin Feldsztejn
Martin Feldsztejn

๐Ÿ› - Martin Lehmann
Martin Lehmann

๐Ÿ› + Martin Feldsztejn
Martin Feldsztejn

๐Ÿ› + Martin Lehmann
Martin Lehmann

๐Ÿ› Martin Spamer
Martin Spamer

๐Ÿ› Martin Tarjรกnyi
Martin Tarjรกnyi

๐Ÿ› MatFl
MatFl

๐Ÿ› Mateusz Stefanski
Mateusz Stefanski

๐Ÿ› Mathieu Gouin
Mathieu Gouin

๐Ÿ› - MatiasComercio
MatiasComercio

๐Ÿ’ป ๐Ÿ› - Matt Benson
Matt Benson

๐Ÿ› + MatiasComercio
MatiasComercio

๐Ÿ’ป ๐Ÿ› + Matt Benson
Matt Benson

๐Ÿ› Matt De Poorter
Matt De Poorter

๐Ÿ› Matt Hargett
Matt Hargett

๐Ÿ’ป ๐Ÿ’ต Matt Harrah
Matt Harrah

๐Ÿ› Matt Nelson
Matt Nelson

๐Ÿ› Matthew Amos
Matthew Amos

๐Ÿ› - Matthew Duggan
Matthew Duggan

๐Ÿ› - Matthew Hall
Matthew Hall

๐Ÿ› + Matthew Duggan
Matthew Duggan

๐Ÿ› + Matthew Hall
Matthew Hall

๐Ÿ› Matรญas Fraga
Matรญas Fraga

๐Ÿ’ป ๐Ÿ› Maxime Robert
Maxime Robert

๐Ÿ’ป ๐Ÿ› MetaBF
MetaBF

๐Ÿ› + Metin Dagcilar
Metin Dagcilar

๐Ÿ› Michael
Michael

๐Ÿ› + + Michael Bell
Michael Bell

๐Ÿ› Michael Bernstein
Michael Bernstein

๐Ÿ› Michael Clay
Michael Clay

๐Ÿ› - - Michael Dombrowski
Michael Dombrowski

๐Ÿ› Michael Hausegger
Michael Hausegger

๐Ÿ› Michael Hoefer
Michael Hoefer

๐Ÿ› Michael Kolesnikov
Michael Kolesnikov

๐Ÿ› + + Michael Mรถbius
Michael Mรถbius

๐Ÿ› Michael N. Lipp
Michael N. Lipp

๐Ÿ› Michael Pellegrini
Michael Pellegrini

๐Ÿ› - - Michal Kordas
Michal Kordas

๐Ÿ› Michaล‚ Borek
Michaล‚ Borek

๐Ÿ› Michaล‚ Kuliล„ski
Michaล‚ Kuliล„ski

๐Ÿ› Miguel Nรบรฑez Dรญaz-Montes
Miguel Nรบรฑez Dรญaz-Montes

๐Ÿ› + + Mihai Ionut
Mihai Ionut

๐Ÿ› Mikhail Kuchma
Mikhail Kuchma

๐Ÿ› Mirek Hankus
Mirek Hankus

๐Ÿ› - - Mitch Spano
Mitch Spano

๐Ÿ› Mladjan Gadzic
Mladjan Gadzic

๐Ÿ› MrAngry52
MrAngry52

๐Ÿ› Muminur Choudhury
Muminur Choudhury

๐Ÿ› + + Mykhailo Palahuta
Mykhailo Palahuta

๐Ÿ’ป ๐Ÿ› Nagendra Kumar Singh
Nagendra Kumar Singh

๐Ÿ› Nahuel Barrios
Nahuel Barrios

๐Ÿ› - - Nakul Sharma
Nakul Sharma

๐Ÿ› Nathan Braun
Nathan Braun

๐Ÿ› Nathan Reynolds
Nathan Reynolds

๐Ÿ› Nathan Reynolds
Nathan Reynolds

๐Ÿ› + + Nathanaรซl
Nathanaรซl

๐Ÿ› Naveen
Naveen

๐Ÿ’ป Nazdravi
Nazdravi

๐Ÿ› - - Neha-Dhonde
Neha-Dhonde

๐Ÿ› Nicholas Doyle
Nicholas Doyle

๐Ÿ› Nick Butcher
Nick Butcher

๐Ÿ› Nico Gallinal
Nico Gallinal

๐Ÿ› + + Nicola Dal Maso
Nicola Dal Maso

๐Ÿ› Nicolas Filotto
Nicolas Filotto

๐Ÿ’ป Nicolas Vervelle
Nicolas Vervelle

๐Ÿ› - - Nicolas Vuillamy
Nicolas Vuillamy

๐Ÿ“– Nikita Chursin
Nikita Chursin

๐Ÿ› Niklas Baudy
Niklas Baudy

๐Ÿ› Nikolas Havrikov
Nikolas Havrikov

๐Ÿ› + + Nilesh Virkar
Nilesh Virkar

๐Ÿ› Nimit Patel
Nimit Patel

๐Ÿ› Niranjan Harpale
Niranjan Harpale

๐Ÿ› - - Nirvik Patel
Nirvik Patel

๐Ÿ’ป Noah Sussman
Noah Sussman

๐Ÿ› Noah0120
Noah0120

๐Ÿ› Noam Tamim
Noam Tamim

๐Ÿ› + + Noel Grandin
Noel Grandin

๐Ÿ› Olaf Haalstra
Olaf Haalstra

๐Ÿ› Oleg Andreych
Oleg Andreych

๐Ÿ’ป ๐Ÿ› - - Oleg Pavlenko
Oleg Pavlenko

๐Ÿ› Oleksii Dykov
Oleksii Dykov

๐Ÿ’ป ๐Ÿ› Oliver Eikemeier
Oliver Eikemeier

๐Ÿ› Oliver Siegmar
Oliver Siegmar

๐Ÿ’ต + + Olivier Parent
Olivier Parent

๐Ÿ’ป ๐Ÿ› Ollie Abbey
Ollie Abbey

๐Ÿ’ป ๐Ÿ› OverDrone
OverDrone

๐Ÿ› - - Ozan Gulle
Ozan Gulle

๐Ÿ’ป ๐Ÿ› PUNEET JAIN
PUNEET JAIN

๐Ÿ› Parbati Bose
Parbati Bose

๐Ÿ› Paul Berg
Paul Berg

๐Ÿ› + + Paul Guyot
Paul Guyot

๐Ÿ’ป Pavel Bludov
Pavel Bludov

๐Ÿ› Pavel Miฤka
Pavel Miฤka

๐Ÿ› - - Pedro Nuno Santos
Pedro Nuno Santos

๐Ÿ› Pedro Rijo
Pedro Rijo

๐Ÿ› Pelisse Romain
Pelisse Romain

๐Ÿ’ป ๐Ÿ“– ๐Ÿ› Per Abich
Per Abich

๐Ÿ’ป + + Pete Davids
Pete Davids

๐Ÿ› Peter Bruin
Peter Bruin

๐Ÿ› Peter Chittum
Peter Chittum

๐Ÿ’ป ๐Ÿ› - - Peter Cudmore
Peter Cudmore

๐Ÿ› Peter Kasson
Peter Kasson

๐Ÿ› Peter Kofler
Peter Kofler

๐Ÿ› Peter Paul Bakker
Peter Paul Bakker

๐Ÿ’ป + + Peter Rader
Peter Rader

๐Ÿ› Pham Hai Trung
Pham Hai Trung

๐Ÿ› Philip Graf
Philip Graf

๐Ÿ’ป ๐Ÿ› - - Philip Hachey
Philip Hachey

๐Ÿ› Philippe Ozil
Philippe Ozil

๐Ÿ› Phinehas Artemix
Phinehas Artemix

๐Ÿ› Phokham Nonava
Phokham Nonava

๐Ÿ› + + Pim van der Loos
Pim van der Loos

๐Ÿ’ป โš ๏ธ Piotr Szymaล„ski
Piotr Szymaล„ski

๐Ÿ› Piotrek ลปygieล‚o
Piotrek ลปygieล‚o

๐Ÿ’ป ๐Ÿ› ๐Ÿ“– - - Pranay Jaiswal
Pranay Jaiswal

๐Ÿ› Prasad Kamath
Prasad Kamath

๐Ÿ› Prasanna
Prasanna

๐Ÿ› Presh-AR
Presh-AR

๐Ÿ› + + Puneet1726
Puneet1726

๐Ÿ› Rafael Cortรชs
Rafael Cortรชs

๐Ÿ› RaheemShaik999
RaheemShaik999

๐Ÿ› - - RajeshR
RajeshR

๐Ÿ’ป ๐Ÿ› Ramachandra Mohan
Ramachandra Mohan

๐Ÿ› Ramel0921
Ramel0921

๐Ÿ› Raquel Pau
Raquel Pau

๐Ÿ› + + Ravikiran Janardhana
Ravikiran Janardhana

๐Ÿ› Reda Benhemmouche
Reda Benhemmouche

๐Ÿ› Reinhard Schiedermeier
Reinhard Schiedermeier

๐Ÿ› - - Renato Oliveira
Renato Oliveira

๐Ÿ’ป ๐Ÿ› Rich DiCroce
Rich DiCroce

๐Ÿ› Richard Corfield
Richard Corfield

๐Ÿ’ป Richard Corfield
Richard Corfield

๐Ÿ› ๐Ÿ’ป + + Riot R1cket
Riot R1cket

๐Ÿ› Rishabh Jain
Rishabh Jain

๐Ÿ› RishabhDeep Singh
RishabhDeep Singh

๐Ÿ› - - + Rob Baillie
Rob Baillie

๐Ÿ› Robbie Martinus
Robbie Martinus

๐Ÿ’ป ๐Ÿ› Robert Henry
Robert Henry

๐Ÿ› Robert Mihaly
Robert Mihaly

๐Ÿ› + + Robert Painsi
Robert Painsi

๐Ÿ› Robert Russell
Robert Russell

๐Ÿ› Robert Sรถsemann
Robert Sรถsemann

๐Ÿ’ป ๐Ÿ“– ๐Ÿ“ข ๐Ÿ› Robert Whitebit
Robert Whitebit

๐Ÿ› - - Robin Richtsfeld
Robin Richtsfeld

๐Ÿ› Robin Stocker
Robin Stocker

๐Ÿ’ป ๐Ÿ› Robin Wils
Robin Wils

๐Ÿ› + + RochusOest
RochusOest

๐Ÿ› Rodolfo Noviski
Rodolfo Noviski

๐Ÿ› Rodrigo Casara
Rodrigo Casara

๐Ÿ› Rodrigo Fernandes
Rodrigo Fernandes

๐Ÿ› - - Roman Salvador
Roman Salvador

๐Ÿ’ป ๐Ÿ› Ronald Blaschke
Ronald Blaschke

๐Ÿ› Rรณbert Papp
Rรณbert Papp

๐Ÿ› + + Saikat Sengupta
Saikat Sengupta

๐Ÿ› Saksham Handu
Saksham Handu

๐Ÿ› Saladoc
Saladoc

๐Ÿ› Salesforce Bob Lightning
Salesforce Bob Lightning

๐Ÿ› - - Sam Carlberg
Sam Carlberg

๐Ÿ› Sashko
Sashko

๐Ÿ’ป Satoshi Kubo
Satoshi Kubo

๐Ÿ› + + Scott Kennedy
Scott Kennedy

๐Ÿ› Scott Wells
Scott Wells

๐Ÿ› ๐Ÿ’ป Scrates1
Scrates1

๐Ÿ› ๐Ÿ’ป Scrsloota
Scrsloota

๐Ÿ’ป - - Sebastian Bรถgl
Sebastian Bรถgl

๐Ÿ› Sebastian Davids
Sebastian Davids

๐Ÿ› Sebastian Schuberth
Sebastian Schuberth

๐Ÿ› + + Sebastian Schwarz
Sebastian Schwarz

๐Ÿ› Seren
Seren

๐Ÿ› ๐Ÿ’ป Sergey Gorbaty
Sergey Gorbaty

๐Ÿ› Sergey Kozlov
Sergey Kozlov

๐Ÿ› - - Sergey Yanzin
Sergey Yanzin

๐Ÿ’ป ๐Ÿ› Seth Wilcox
Seth Wilcox

๐Ÿ’ป Shai Bennathan
Shai Bennathan

๐Ÿ› ๐Ÿ’ป + + Shubham
Shubham

๐Ÿ’ป ๐Ÿ› Simon Abykov
Simon Abykov

๐Ÿ’ป ๐Ÿ› Simon Xiao
Simon Xiao

๐Ÿ› Srinivasan Venkatachalam
Srinivasan Venkatachalam

๐Ÿ› - - Stanislav Gromov
Stanislav Gromov

๐Ÿ› Stanislav Myachenkov
Stanislav Myachenkov

๐Ÿ’ป Stefan Birkner
Stefan Birkner

๐Ÿ› + + Stefan Bohn
Stefan Bohn

๐Ÿ› Stefan Endrullis
Stefan Endrullis

๐Ÿ› Stefan Klรถss-Schuster
Stefan Klรถss-Schuster

๐Ÿ› Stefan Wolf
Stefan Wolf

๐Ÿ› - - Stephan H. Wissel
Stephan H. Wissel

๐Ÿ› Stephen
Stephen

๐Ÿ› Stephen Friedrich
Stephen Friedrich

๐Ÿ› + + Steve Babula
Steve Babula

๐Ÿ’ป Steven Stearns
Steven Stearns

๐Ÿ› ๐Ÿ’ป Stexxe
Stexxe

๐Ÿ› Stian Lรฅgstad
Stian Lรฅgstad

๐Ÿ› - - StuartClayton5
StuartClayton5

๐Ÿ› Supun Arunoda
Supun Arunoda

๐Ÿ› Suren Abrahamyan
Suren Abrahamyan

๐Ÿ› + + Suvashri
Suvashri

๐Ÿ“– SwatiBGupta1110
SwatiBGupta1110

๐Ÿ› SyedThoufich
SyedThoufich

๐Ÿ› Szymon Sasin
Szymon Sasin

๐Ÿ› - - T-chuangxin
T-chuangxin

๐Ÿ› TERAI Atsuhiro
TERAI Atsuhiro

๐Ÿ› TIOBE Software
TIOBE Software

๐Ÿ’ป ๐Ÿ› + + Tarush Singh
Tarush Singh

๐Ÿ’ป Taylor Smock
Taylor Smock

๐Ÿ› Techeira Damiรกn
Techeira Damiรกn

๐Ÿ’ป ๐Ÿ› Ted Husted
Ted Husted

๐Ÿ› - - TehBakker
TehBakker

๐Ÿ› The Gitter Badger
The Gitter Badger

๐Ÿ› Theodoor
Theodoor

๐Ÿ› + + Thiago Henrique Hรผpner
Thiago Henrique Hรผpner

๐Ÿ› Thibault Meyer
Thibault Meyer

๐Ÿ› Thomas Gรผttler
Thomas Gรผttler

๐Ÿ› Thomas Jones-Low
Thomas Jones-Low

๐Ÿ› - - Thomas Smith
Thomas Smith

๐Ÿ’ป ๐Ÿ› ThrawnCA
ThrawnCA

๐Ÿ› Thu Vo
Thu Vo

๐Ÿ› + + Thunderforge
Thunderforge

๐Ÿ’ป ๐Ÿ› Tim van der Lippe
Tim van der Lippe

๐Ÿ› Tobias Weimer
Tobias Weimer

๐Ÿ’ป ๐Ÿ› Tom Copeland
Tom Copeland

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– - - Tom Daly
Tom Daly

๐Ÿ› Tomer Figenblat
Tomer Figenblat

๐Ÿ› Tomi De Lucca
Tomi De Lucca

๐Ÿ’ป ๐Ÿ› + + Torsten Kleiber
Torsten Kleiber

๐Ÿ› TrackerSB
TrackerSB

๐Ÿ› Tyson Stewart
Tyson Stewart

๐Ÿ› Ullrich Hafner
Ullrich Hafner

๐Ÿ› - - Utku Cuhadaroglu
Utku Cuhadaroglu

๐Ÿ’ป ๐Ÿ› Valentin Brandl
Valentin Brandl

๐Ÿ› Valeria
Valeria

๐Ÿ› + + Valery Yatsynovich
Valery Yatsynovich

๐Ÿ“– Vasily Anisimov
Vasily Anisimov

๐Ÿ› Vibhor Goyal
Vibhor Goyal

๐Ÿ› Vickenty Fesunov
Vickenty Fesunov

๐Ÿ› - - Victor Noรซl
Victor Noรซl

๐Ÿ› Vincent Galloy
Vincent Galloy

๐Ÿ’ป Vincent HUYNH
Vincent HUYNH

๐Ÿ› + + Vincent Maurin
Vincent Maurin

๐Ÿ› Vincent Privat
Vincent Privat

๐Ÿ› Vishhwas
Vishhwas

๐Ÿ› Vishv_Android
Vishv_Android

๐Ÿ› - - Vitaly
Vitaly

๐Ÿ› Vitaly Polonetsky
Vitaly Polonetsky

๐Ÿ› Vojtech Polivka
Vojtech Polivka

๐Ÿ› + + Vsevolod Zholobov
Vsevolod Zholobov

๐Ÿ› Vyom Yadav
Vyom Yadav

๐Ÿ’ป Wang Shidong
Wang Shidong

๐Ÿ› Waqas Ahmed
Waqas Ahmed

๐Ÿ› - - Wayne J. Earl
Wayne J. Earl

๐Ÿ› Wchenghui
Wchenghui

๐Ÿ› Wener
Wener

๐Ÿ’ป + + Will Winder
Will Winder

๐Ÿ› William Brockhus
William Brockhus

๐Ÿ’ป ๐Ÿ› Wilson Kurniawan
Wilson Kurniawan

๐Ÿ› Wim Deblauwe
Wim Deblauwe

๐Ÿ› - - Woongsik Choi
Woongsik Choi

๐Ÿ› XenoAmess
XenoAmess

๐Ÿ’ป ๐Ÿ› Yang
Yang

๐Ÿ’ป + + YaroslavTER
YaroslavTER

๐Ÿ› Yasar Shaikh
Yasar Shaikh

๐Ÿ’ป Young Chan
Young Chan

๐Ÿ’ป ๐Ÿ› YuJin Kim
YuJin Kim

๐Ÿ› - - Yuri Dolzhenko
Yuri Dolzhenko

๐Ÿ› Yurii Dubinka
Yurii Dubinka

๐Ÿ› Zoltan Farkas
Zoltan Farkas

๐Ÿ› + + Zustin
Zustin

๐Ÿ› aaronhurst-google
aaronhurst-google

๐Ÿ› ๐Ÿ’ป alexmodis
alexmodis

๐Ÿ› andreoss
andreoss

๐Ÿ› - - andrey81inmd
andrey81inmd

๐Ÿ’ป ๐Ÿ› anicoara
anicoara

๐Ÿ› arunprasathav
arunprasathav

๐Ÿ› + + asiercamara
asiercamara

๐Ÿ› astillich-igniti
astillich-igniti

๐Ÿ’ป avesolovksyy
avesolovksyy

๐Ÿ› avishvat
avishvat

๐Ÿ› - - avivmu
avivmu

๐Ÿ› axelbarfod1
axelbarfod1

๐Ÿ› b-3-n
b-3-n

๐Ÿ› + + balbhadra9
balbhadra9

๐Ÿ› base23de
base23de

๐Ÿ› bergander
bergander

๐Ÿ› ๐Ÿ’ป berkam
berkam

๐Ÿ’ป ๐Ÿ› - - breizh31
breizh31

๐Ÿ› caesarkim
caesarkim

๐Ÿ› carolyujing
carolyujing

๐Ÿ› + + cbfiddle
cbfiddle

๐Ÿ› cesares-basilico
cesares-basilico

๐Ÿ› chrite
chrite

๐Ÿ› ciufudean
ciufudean

๐Ÿ“– - - cobratbq
cobratbq

๐Ÿ› coladict
coladict

๐Ÿ› cosmoJFH
cosmoJFH

๐Ÿ› + + cristalp
cristalp

๐Ÿ› crunsk
crunsk

๐Ÿ› cwholmes
cwholmes

๐Ÿ› cyberjj999
cyberjj999

๐Ÿ› - - cyw3
cyw3

๐Ÿ› ๐Ÿ“– d1ss0nanz
d1ss0nanz

๐Ÿ› dague1
dague1

๐Ÿ“– + + dalizi007
dalizi007

๐Ÿ’ป danbrycefairsailcom
danbrycefairsailcom

๐Ÿ› dariansanity
dariansanity

๐Ÿ› darrenmiliband
darrenmiliband

๐Ÿ› - - davidburstrom
davidburstrom

๐Ÿ› dbirkman-paloalto
dbirkman-paloalto

๐Ÿ› deepak-patra
deepak-patra

๐Ÿ› + + dependabot[bot]
dependabot[bot]

๐Ÿ’ป ๐Ÿ› dinesh150
dinesh150

๐Ÿ› diziaq
diziaq

๐Ÿ› dreaminpast123
dreaminpast123

๐Ÿ› - - duanyanan
duanyanan

๐Ÿ› dutt-sanjay
dutt-sanjay

๐Ÿ› dylanleung
dylanleung

๐Ÿ› + + dzeigler
dzeigler

๐Ÿ› eant60
eant60

๐Ÿ› ekkirala
ekkirala

๐Ÿ› emersonmoura
emersonmoura

๐Ÿ› - - emouty
emouty

๐Ÿ’ป eugenepugach
eugenepugach

๐Ÿ› fairy
fairy

๐Ÿ› + + filiprafalowicz
filiprafalowicz

๐Ÿ’ป flxbl-io
flxbl-io

๐Ÿ’ต foxmason
foxmason

๐Ÿ› frankegabor
frankegabor

๐Ÿ› - - frankl
frankl

๐Ÿ› freafrea
freafrea

๐Ÿ› fsapatin
fsapatin

๐Ÿ› + + gracia19
gracia19

๐Ÿ› guo fei
guo fei

๐Ÿ› gurmsc5
gurmsc5

๐Ÿ› gwilymatgearset
gwilymatgearset

๐Ÿ’ป ๐Ÿ› - - haigsn
haigsn

๐Ÿ› hemanshu070
hemanshu070

๐Ÿ› henrik242
henrik242

๐Ÿ› + + hongpuwu
hongpuwu

๐Ÿ› hvbtup
hvbtup

๐Ÿ’ป ๐Ÿ› igniti GmbH
igniti GmbH

๐Ÿ› ilovezfs
ilovezfs

๐Ÿ› - - itaigilo
itaigilo

๐Ÿ› jakivey32
jakivey32

๐Ÿ› jbennett2091
jbennett2091

๐Ÿ› + + jcamerin
jcamerin

๐Ÿ› jkeener1
jkeener1

๐Ÿ› jmetertea
jmetertea

๐Ÿ› johnra2
johnra2

๐Ÿ’ป - - josemanuelrolon
josemanuelrolon

๐Ÿ’ป ๐Ÿ› kabroxiko
kabroxiko

๐Ÿ’ป ๐Ÿ› karwer
karwer

๐Ÿ› + + kaulonline
kaulonline

๐Ÿ› kdaemonv
kdaemonv

๐Ÿ› kdebski85
kdebski85

๐Ÿ› ๐Ÿ’ป kenji21
kenji21

๐Ÿ’ป ๐Ÿ› - - kfranic
kfranic

๐Ÿ› khalidkh
khalidkh

๐Ÿ› koalalam
koalalam

๐Ÿ› + + krzyk
krzyk

๐Ÿ› lasselindqvist
lasselindqvist

๐Ÿ› lgemeinhardt
lgemeinhardt

๐Ÿ› lihuaib
lihuaib

๐Ÿ› - - liqingjun123
liqingjun123

๐Ÿ› lonelyma1021
lonelyma1021

๐Ÿ› lpeddy
lpeddy

๐Ÿ› + + lujiefsi
lujiefsi

๐Ÿ’ป lukelukes
lukelukes

๐Ÿ’ป lyriccoder
lyriccoder

๐Ÿ› marcelmore
marcelmore

๐Ÿ› - - matchbox
matchbox

๐Ÿ› matthiaskraaz
matthiaskraaz

๐Ÿ› meandonlyme
meandonlyme

๐Ÿ› - mikesive
mikesive

๐Ÿ› - milossesic
milossesic

๐Ÿ› - mluckam
mluckam

๐Ÿ’ป - mohan-chinnappan-n
mohan-chinnappan-n

๐Ÿ’ป + mikesive
mikesive

๐Ÿ› + milossesic
milossesic

๐Ÿ› + mluckam
mluckam

๐Ÿ’ป ๐Ÿ› + mohan-chinnappan-n
mohan-chinnappan-n

๐Ÿ’ป mriddell95
mriddell95

๐Ÿ› mrlzh
mrlzh

๐Ÿ› msloan
msloan

๐Ÿ› + + mucharlaravalika
mucharlaravalika

๐Ÿ› mvenneman
mvenneman

๐Ÿ› nareshl119
nareshl119

๐Ÿ› nicolas-harraudeau-sonarsource
nicolas-harraudeau-sonarsource

๐Ÿ› - - noerremark
noerremark

๐Ÿ› novsirion
novsirion

๐Ÿ› nwcm
nwcm

๐Ÿ“– ๐Ÿ› ๐Ÿ’ป + + oggboy
oggboy

๐Ÿ› oinume
oinume

๐Ÿ› orimarko
orimarko

๐Ÿ’ป ๐Ÿ› pacvz
pacvz

๐Ÿ’ป - - pallavi agarwal
pallavi agarwal

๐Ÿ› parksungrin
parksungrin

๐Ÿ› patpatpat123
patpatpat123

๐Ÿ› + + patriksevallius
patriksevallius

๐Ÿ› pbrajesh1
pbrajesh1

๐Ÿ› phoenix384
phoenix384

๐Ÿ› piotrszymanski-sc
piotrszymanski-sc

๐Ÿ’ป - - plan3d
plan3d

๐Ÿ› poojasix
poojasix

๐Ÿ› prabhushrikant
prabhushrikant

๐Ÿ› + + pujitha8783
pujitha8783

๐Ÿ› r-r-a-j
r-r-a-j

๐Ÿ› raghujayjunk
raghujayjunk

๐Ÿ› rajeshveera
rajeshveera

๐Ÿ› - - rajeswarreddy88
rajeswarreddy88

๐Ÿ› recdevs
recdevs

๐Ÿ› reudismam
reudismam

๐Ÿ’ป ๐Ÿ› + + rijkt
rijkt

๐Ÿ› rillig-tk
rillig-tk

๐Ÿ› rmohan20
rmohan20

๐Ÿ’ป ๐Ÿ› rnveach
rnveach

๐Ÿ› - - rxmicro
rxmicro

๐Ÿ› ryan-gustafson
ryan-gustafson

๐Ÿ’ป ๐Ÿ› sabi0
sabi0

๐Ÿ› + + scais
scais

๐Ÿ› screamingfrog
screamingfrog

๐Ÿ’ต sebbASF
sebbASF

๐Ÿ› sergeygorbaty
sergeygorbaty

๐Ÿ’ป - - shilko2013
shilko2013

๐Ÿ› shiomiyan
shiomiyan

๐Ÿ“– simeonKondr
simeonKondr

๐Ÿ› + + snajberk
snajberk

๐Ÿ› sniperrifle2004
sniperrifle2004

๐Ÿ› snuyanzin
snuyanzin

๐Ÿ› ๐Ÿ’ป soyodream
soyodream

๐Ÿ› - - sratz
sratz

๐Ÿ› stonio
stonio

๐Ÿ› sturton
sturton

๐Ÿ’ป ๐Ÿ› + + sudharmohan
sudharmohan

๐Ÿ› suruchidawar
suruchidawar

๐Ÿ› svenfinitiv
svenfinitiv

๐Ÿ› tashiscool
tashiscool

๐Ÿ› - - test-git-hook
test-git-hook

๐Ÿ› testation21
testation21

๐Ÿ’ป ๐Ÿ› thanosa
thanosa

๐Ÿ› + + tiandiyixian
tiandiyixian

๐Ÿ› tobwoerk
tobwoerk

๐Ÿ› tprouvot
tprouvot

๐Ÿ› ๐Ÿ’ป trentchilders
trentchilders

๐Ÿ› - - triandicAnt
triandicAnt

๐Ÿ› trishul14
trishul14

๐Ÿ› tsui
tsui

๐Ÿ› + + wangzitom12306
wangzitom12306

๐Ÿ› winhkey
winhkey

๐Ÿ› witherspore
witherspore

๐Ÿ› wjljack
wjljack

๐Ÿ› - - wuchiuwong
wuchiuwong

๐Ÿ› xingsong
xingsong

๐Ÿ› xioayuge
xioayuge

๐Ÿ› + + xnYi9wRezm
xnYi9wRezm

๐Ÿ’ป ๐Ÿ› xuanuy
xuanuy

๐Ÿ› xyf0921
xyf0921

๐Ÿ› yalechen-cyw3
yalechen-cyw3

๐Ÿ› - - yasuharu-sato
yasuharu-sato

๐Ÿ› zenglian
zenglian

๐Ÿ› zgrzyt93
zgrzyt93

๐Ÿ’ป ๐Ÿ› + + zh3ng
zh3ng

๐Ÿ› zt_soft
zt_soft

๐Ÿ› ztt79
ztt79

๐Ÿ› zzzzfeng
zzzzfeng

๐Ÿ› - - รrpรกd Magosรกnyi
รrpรกd Magosรกnyi

๐Ÿ› ไปป่ดตๆฐ
ไปป่ดตๆฐ

๐Ÿ› ่Œ…ๅปถๅฎ‰
่Œ…ๅปถๅฎ‰

๐Ÿ’ป From b2f6c9a85a7306b6b5fec7b0230eae99a2e95e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 23 May 2024 09:46:43 -0300 Subject: [PATCH 098/121] Update changelog, refs #5029 --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 0d7a371c6e..1610b9fafc 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -35,6 +35,7 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration * [#5006](https://github.com/pmd/pmd/issues/5006): \[java] Bad intersection, unrelated class types Child and Parent + * [#5029](https://github.com/pmd/pmd/issues/5029): \[java] PMD 7.x throws stack overflow in TypeOps$ProjectionVisitor while parsing a Java class * java-bestpractices * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name * [#4852](https://github.com/pmd/pmd/issues/4852): \[java] ReplaceVectorWithList false-positive (neither Vector nor List usage) From f30b535f61737f18f5ded94f3261f6314d26814b Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 23 May 2024 18:20:08 +0200 Subject: [PATCH 099/121] Update pmd-designer 7.2.0-SNAPSHOT --- docs/pages/release_notes.md | 5 +++++ pom.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index a753816b29..349799523a 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -24,6 +24,11 @@ Since this release, PMD will also expose any getter returning a collection of an /UserClass[@InterfaceNames = 'Queueable'] ``` +#### Updated PMD Designer + +This PMD release ships a new version of the pmd-designer. +For the changes, see [PMD Designer Changelog (7.2.0)](https://github.com/pmd/pmd-designer/releases/tag/7.2.0). + ### ๐Ÿ› Fixed Issues * core * [#4467](https://github.com/pmd/pmd/issues/4467): \[core] Expose collections from getters as XPath sequence attributes diff --git a/pom.xml b/pom.xml index e5b7e66827..dc9be10427 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ 24 - 7.0.0 + 7.2.0-SNAPSHOT ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar ${project.build.directory}/generated-sources/javacc ${project.basedir}/../javacc-wrapper.xml From 1bde246b8b878acd2a7856701695fc57f7b54f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 23 May 2024 21:07:27 +0200 Subject: [PATCH 100/121] Fix some FNs --- .../types/ast/internal/LazyTypeResolver.java | 4 +- .../types/ast/internal/PolyResolution.java | 33 ++++++--- .../java/types/ast/ConversionContextTests.kt | 56 +++++++++++++++ .../internal/infer/StandaloneTypesTest.kt | 18 +++++ .../rule/codestyle/xml/UnnecessaryBoxing.xml | 70 +++++++++++++++++++ 5 files changed, 170 insertions(+), 11 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/LazyTypeResolver.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/LazyTypeResolver.java index ff635788b1..5a47ae6223 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/LazyTypeResolver.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/LazyTypeResolver.java @@ -326,8 +326,8 @@ public final class LazyTypeResolver extends JavaVisitorBase promote(N, M) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index 084098baa0..f07054a742 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -15,6 +15,7 @@ import static net.sourceforge.pmd.util.AssertionUtil.shouldNotReachHere; import static net.sourceforge.pmd.util.CollectionUtil.all; import static net.sourceforge.pmd.util.CollectionUtil.map; +import java.util.EnumMap; import java.util.List; import org.checkerframework.checker.nullness.qual.NonNull; @@ -56,6 +57,7 @@ import net.sourceforge.pmd.lang.java.ast.internal.JavaAstUtils; import net.sourceforge.pmd.lang.java.types.JClassType; import net.sourceforge.pmd.lang.java.types.JMethodSig; import net.sourceforge.pmd.lang.java.types.JPrimitiveType; +import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind; import net.sourceforge.pmd.lang.java.types.JTypeMirror; import net.sourceforge.pmd.lang.java.types.OverloadSelectionResult; import net.sourceforge.pmd.lang.java.types.TypeConversion; @@ -85,6 +87,7 @@ public final class PolyResolution { private final ExprContext booleanCtx; private final ExprContext stringCtx; private final ExprContext intCtx; + private final EnumMap numericContexts; PolyResolution(Infer infer) { this.infer = infer; @@ -93,7 +96,13 @@ public final class PolyResolution { this.stringCtx = newStringCtx(ts); this.booleanCtx = newNonPolyContext(ts.BOOLEAN); - this.intCtx = newNumericContext(ts.INT); + this.numericContexts = new EnumMap<>(PrimitiveTypeKind.class); + for (PrimitiveTypeKind kind : PrimitiveTypeKind.values()) { + if (kind != PrimitiveTypeKind.BOOLEAN) { + this.numericContexts.put(kind, newOtherContext(ts.getPrimitive(kind), ExprContextKind.NUMERIC)); + } + } + this.intCtx = numericContexts.get(PrimitiveTypeKind.INT); } private boolean isPreJava8() { @@ -566,12 +575,12 @@ public final class PolyResolution { case OR: case XOR: case AND: - return ctxType == ts.BOOLEAN ? booleanCtx : newNumericContext(ctxType); // NOPMD CompareObjectsWithEquals + return ctxType == ts.BOOLEAN ? booleanCtx : getNumericContext(ctxType); // NOPMD CompareObjectsWithEquals case LEFT_SHIFT: case RIGHT_SHIFT: case UNSIGNED_RIGHT_SHIFT: return node.getIndexInParent() == 1 ? intCtx - : newNumericContext(nodeType.unbox()); + : getNumericContext(nodeType.unbox()); case EQ: case NE: if (otherType.isNumeric() || nodeType.isNumeric()) { @@ -580,8 +589,12 @@ public final class PolyResolution { // cannot be promoted return ExprContext.getMissingInstance(); } - return newNumericContext(prom); + return getNumericContext(prom); + } else if (otherType.isPrimitive(PrimitiveTypeKind.BOOLEAN) + || nodeType.isPrimitive(PrimitiveTypeKind.BOOLEAN)) { + return booleanCtx; } + return ExprContext.getMissingInstance(); case ADD: if (TypeTestUtil.isA(String.class, ctxType)) { @@ -593,12 +606,12 @@ public final class PolyResolution { case MUL: case DIV: case MOD: - return newNumericContext(ctxType); // binary promoted by LazyTypeResolver + return getNumericContext(ctxType); // binary promoted by LazyTypeResolver case LE: case GE: case GT: case LT: - return newNumericContext(TypeConversion.binaryNumericPromotion(nodeType, otherType)); + return getNumericContext(TypeConversion.binaryNumericPromotion(nodeType, otherType)); default: return ExprContext.getMissingInstance(); } @@ -612,13 +625,15 @@ public final class PolyResolution { break; } // this was already unary promoted - return newNumericContext(parentType); + return getNumericContext(parentType); case NEGATION: return booleanCtx; default: break; } return ExprContext.getMissingInstance(); + } else if (papa instanceof ASTSwitchLike && node.getIndexInParent() == 0) { + return getNumericContext(((ASTExpression) node).getTypeMirror().unbox()); } else { return ExprContext.getMissingInstance(); } @@ -716,10 +731,10 @@ public final class PolyResolution { return newOtherContext(stringType, ExprContextKind.STRING); } - static ExprContext newNumericContext(JTypeMirror targetType) { + ExprContext getNumericContext(JTypeMirror targetType) { if (targetType.isPrimitive()) { assert targetType.isNumeric() : "Not a numeric type - " + targetType; - return newOtherContext(targetType, ExprContextKind.NUMERIC); + return numericContexts.get(((JPrimitiveType) targetType).getKind()); } return ExprContext.getMissingInstance(); // error } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt index 3332d10ff1..0a244fbcc1 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/ast/ConversionContextTests.kt @@ -295,6 +295,62 @@ class ConversionContextTests : ProcessorTestSpec({ } } + parserTest("Boolean contexts") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(boolean a, Boolean b) { + eat(a == b); + eat(a != b); + eat(a && b); + eat(a || b); + eat(a ^ b); + eat(a & b); + eat(a | b); + } + void eat(Object d) {} + } + """ + ) + + val exprs = acu.descendants(ASTVariableAccess::class.java).toList() + + spy.shouldBeOk { + for (e in exprs) { + withClue(e.parent) { + e should haveBooleanContext() + } + } + } + } + + parserTest("Switch scrutinee") { + + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + class Scratch { + static void m(boolean a, Boolean b) { + switch (4) { } + switch (Integer.valueOf(4)) { } + + } + void eat(Object d) {} + } + """ + ) + + val exprs = acu.descendants(ASTSwitchLike::class.java).toList { it.testedExpression } + + spy.shouldBeOk { + for (e in exprs) { + withClue(e.parent) { + e should haveContext(NUMERIC, int) + } + } + } + } + parserTest("Lambda ctx") { val (acu, spy) = parser.parseWithTypeInferenceSpy(""" diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt index e7877f7152..9d82863acf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/StandaloneTypesTest.kt @@ -96,6 +96,7 @@ class StandaloneTypesTest : ProcessorTestSpec({ } + parserTest("Test array initializer") { val block = StatementParsingCtx.parseNode("{ int[] is = { a }; int[][] iis = { { } }; }", ctx = this) @@ -178,6 +179,23 @@ class StandaloneTypesTest : ProcessorTestSpec({ } } + parserTest("Test boolean bitwise ops") { + + inContext(ExpressionParsingCtx) { + + listOf(OR, AND, XOR) + .forEach { + + val op = it.token + + "true $op (Boolean) true" should haveType { boolean } + "(Boolean) true $op false" should haveType { boolean } + "(Boolean) true $op (Boolean) false" should haveType { boolean } + "true $op false" should haveType { boolean } + } + } + } + parserTest("Test boolean ops") { inContext(ExpressionParsingCtx) { diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml index 466dcdba73..d36a46be5d 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryBoxing.xml @@ -548,6 +548,76 @@ public class Foo { } ]]> + + Long valueOf + 1 + 5 + + Unnecessary explicit conversion from int to long through Long + + + + + Boolean valueof + 1 + 5 + + Unnecessary explicit unboxing + + + + + Long ctor call + 0 + + + + Switch scrutinee + 1 + + Unboxing in lambda return position which returns inferred type 2 From edb733f8352a132ea0621d1e7fb6fd881f779eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 23 May 2024 21:10:58 +0200 Subject: [PATCH 101/121] Add test for UnnecessaryCast --- .../rule/codestyle/xml/UnnecessaryCast.xml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml index ebac87a9f5..53072694c5 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/codestyle/xml/UnnecessaryCast.xml @@ -866,4 +866,26 @@ class MyClass { } ]]> + + Unboxing in lambda + 1 + 4 + mismatch = payload -> (int) payload; // nowarn: here the cast does a null check + RefSpecies i = t -> (int) t; // nowarn: here the cast does a null check + IntSpecies i = t -> (int) t; // warn: in this context t->t is equivalent because it will be unboxed + + interface VoidSpecies { + void doSomething(T t); + } + interface RefSpecies { + X foo(T t); + } + interface IntSpecies { + int foo(T t); + } + } + ]]> + From 4ea0c07162268d684aa65f82b78455a172d5318c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Thu, 23 May 2024 21:17:17 +0200 Subject: [PATCH 102/121] Fix pmd warning --- .../pmd/lang/java/types/ast/internal/PolyResolution.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java index f07054a742..cbafde4470 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/ast/internal/PolyResolution.java @@ -17,6 +17,7 @@ import static net.sourceforge.pmd.util.CollectionUtil.map; import java.util.EnumMap; import java.util.List; +import java.util.Map; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -87,7 +88,7 @@ public final class PolyResolution { private final ExprContext booleanCtx; private final ExprContext stringCtx; private final ExprContext intCtx; - private final EnumMap numericContexts; + private final Map numericContexts; PolyResolution(Infer infer) { this.infer = infer; From 37451931dc0b290c7de44691bea2b175f6d34612 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 09:40:27 +0200 Subject: [PATCH 103/121] [test] Add missing junit jupiter engine --- pmd-test/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 9ffded1716..eb12a659b0 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -80,6 +80,12 @@ org.slf4j slf4j-simple + + + org.junit.jupiter + junit-jupiter-engine + test + org.mockito mockito-core From 224f5b83039b646c1dd5f29b9453346006425159 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 09:59:35 +0200 Subject: [PATCH 104/121] [doc] Update release notes (#4903, #4924, #5019) --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 349799523a..9c35bd6bfd 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -48,6 +48,8 @@ For the changes, see [PMD Designer Changelog (7.2.0)](https://github.com/pmd/pmd * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle + * [#4903](https://github.com/pmd/pmd/issues/4903): \[java] UnnecessaryBoxing, but explicit conversion is necessary + * [#4924](https://github.com/pmd/pmd/issues/4924): \[java] UnnecessaryBoxing false positive in PMD 7.0.0 in lambda * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources * [#4954](https://github.com/pmd/pmd/issues/4954): \[java] LocalVariableNamingConventions should allow unnamed variables by default * [#5028](https://github.com/pmd/pmd/issues/5028): \[java] FormalParameterNamingConventions should accept unnamed parameters by default From 8a8402a0bd255c46375d452092643ef31bde7ba2 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 10:37:05 +0200 Subject: [PATCH 105/121] [doc] Update release notes (#1619, #3122, #5003) --- docs/pages/release_notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 44f8bf9e73..97c8bf12e0 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -40,6 +40,8 @@ Since this release, PMD will also expose any getter returning a collection of an * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object * java-codestyle + * [#1619](https://github.com/pmd/pmd/issues/1619): \[java] LocalVariableCouldBeFinal on 'size' variable in for loop + * [#3122](https://github.com/pmd/pmd/issues/3122): \[java] LocalVariableCouldBeFinal should consider blank local variables * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources ### ๐Ÿšจ API Changes From d37769e71c64b9c8ffdea521bade7a17b0da39a8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 10:40:36 +0200 Subject: [PATCH 106/121] Bump builds-tools from 25-SNAPSHOT to 25 --- .github/workflows/build.yml | 2 +- .github/workflows/git-repo-sync.yml | 2 +- .github/workflows/troubleshooting.yml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e37d01fa33..8e92a17d9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/24/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/.github/workflows/git-repo-sync.yml b/.github/workflows/git-repo-sync.yml index d0327c4e2b..e8a3597c88 100644 --- a/.github/workflows/git-repo-sync.yml +++ b/.github/workflows/git-repo-sync.yml @@ -24,7 +24,7 @@ jobs: shell: bash run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/24/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV - name: Sync run: .ci/git-repo-sync.sh shell: bash diff --git a/.github/workflows/troubleshooting.yml b/.github/workflows/troubleshooting.yml index 010e2a0fc4..db94722919 100644 --- a/.github/workflows/troubleshooting.yml +++ b/.github/workflows/troubleshooting.yml @@ -36,7 +36,7 @@ jobs: run: | echo "LANG=en_US.UTF-8" >> $GITHUB_ENV echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV - echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/24/scripts" >> $GITHUB_ENV + echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/25/scripts" >> $GITHUB_ENV - name: Check Environment shell: bash run: | diff --git a/pom.xml b/pom.xml index c8e5bda16c..67b29d1f28 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ -Xmx512m -Dfile.encoding=${project.build.sourceEncoding} ${extraArgLine} - 25-SNAPSHOT + 25 7.2.0-SNAPSHOT ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar From e27b30e0b52229f66c5dae8aab0c2b95d877a135 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 11:21:36 +0200 Subject: [PATCH 107/121] Bump pmd-designer from 7.2.0-SNAPSHOT to 7.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 67b29d1f28..08703ea417 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ 25 - 7.2.0-SNAPSHOT + 7.2.0 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar ${project.build.directory}/generated-sources/javacc ${project.basedir}/../javacc-wrapper.xml From 27a14cc61e4659447125422756e545fe2a7b96f0 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 12:33:41 +0200 Subject: [PATCH 108/121] Prepare pmd release 7.2.0 --- docs/_config.yml | 2 +- docs/pages/release_notes.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index f53795d99a..fd664fbf41 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,7 +1,7 @@ repository: pmd/pmd pmd: - version: 7.2.0-SNAPSHOT + version: 7.2.0 previous_version: 7.1.0 date: 31-May-2024 release_type: minor diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 946fc1f8d3..e8d4a701dd 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -73,5 +73,9 @@ For the changes, see [PMD Designer Changelog (7.2.0)](https://github.com/pmd/pmd * [#5020](https://github.com/pmd/pmd/issues/5020): \[java] Fix AvoidUsingOctalValues false-positive - [Gold856](https://github.com/Gold856) (@Gold856) -{% endtocmaker %} +### ๐Ÿ“ˆ Stats +* 152 commits +* 46 closed tickets & PRs +* Days since last release: 35 +{% endtocmaker %} From 38bc997d4e7f4b29cee86829915f17f925211800 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 12:57:36 +0200 Subject: [PATCH 109/121] [release] prepare release pmd_releases/7.2.0 --- pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-compat6/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-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/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-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 6 +++--- 43 files changed, 45 insertions(+), 45 deletions(-) diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index ce517cdd1a..d28f7c06e4 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.2.0-SNAPSHOT + 7.2.0 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 42af8646ed..30d49d8f90 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 9b7a284ad1..7eb3a5e724 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index fe97db0606..ee14507e27 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-compat6/pom.xml b/pmd-compat6/pom.xml index c2f957d9a1..09bff36dab 100644 --- a/pmd-compat6/pom.xml +++ b/pmd-compat6/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 pmd-compat6 diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index 62e389fde9..f1c7b1e86d 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 83e10131b0..2354bee920 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index 35d1e15296..b35ff6d715 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 795188bfe7..5c5c1e9996 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 72a6d4c1d5..649d40f25e 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 2d9a5acba0..72323c14e6 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 754de6aa55..7b7040bcb9 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index 79f5588ae7..6c06886317 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index e3e1490468..477c14aa8d 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index 677f0d4559..5c405f30d7 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index c1168e66f5..7d5318fa66 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index b85f32cfb0..9f5dfd0fdb 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index 72383cc5f4..d1c674e8b6 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index eec8282f65..f80e5143eb 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index 6ec7333e73..f6db428b5a 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index d27eaa6d4f..d437e231ff 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index f4a8683885..1bff3ef16d 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index 1a85089052..93512a36c3 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 90ee0372cc..9f7228936a 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 7c4720f2e0..288d5d08bd 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index f58bc85456..09033b979d 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 2604418fa1..1dd7bf0a7e 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 87f9b71de0..9b5d15fb31 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 2a0024663e..08e86b38e8 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index a5d78eb138..29cc36da7f 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 544653426a..3458ee1e81 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index b3f4438adb..8885449b2f 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-scala-modules/pmd-scala-common/pom.xml b/pmd-scala-modules/pmd-scala-common/pom.xml index 53c5eb2fc4..17e30ae260 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 - 7.2.0-SNAPSHOT + 7.2.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 baaab7828f..3520f2de37 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 - 7.2.0-SNAPSHOT + 7.2.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 4de45c6687..a43cd14e21 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 - 7.2.0-SNAPSHOT + 7.2.0 ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 266dba8c63..68044d16ba 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index 0e823d7615..bed7f20233 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index eb12a659b0..11bc0c3d77 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 9be8d9d168..6914974413 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index 06340fa7b1..4f6ba4e332 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index 735f07a958..bd93ce3b36 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index 183347631e..a89b017a42 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 ../pom.xml diff --git a/pom.xml b/pom.xml index 08703ea417..5c340318fc 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.2.0-SNAPSHOT + 7.2.0 pom PMD @@ -62,7 +62,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/7.2.0 @@ -83,7 +83,7 @@ - 2024-04-26T06:14:52Z + 2024-05-31T10:33:57Z 8 From 28c6c8e1210e1c4591ba8aa1d0ae537a538eb104 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 31 May 2024 13:21:14 +0200 Subject: [PATCH 110/121] [release] Prepare next development version [skip ci] --- docs/_config.yml | 6 +- docs/pages/release_notes.md | 59 +-------------- docs/pages/release_notes_old.md | 83 ++++++++++++++++++++++ pmd-ant/pom.xml | 2 +- pmd-apex/pom.xml | 2 +- pmd-cli/pom.xml | 2 +- pmd-coco/pom.xml | 2 +- pmd-compat6/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-javascript/pom.xml | 2 +- pmd-jsp/pom.xml | 2 +- pmd-julia/pom.xml | 2 +- pmd-kotlin/pom.xml | 2 +- pmd-lang-test/pom.xml | 2 +- pmd-languages-deps/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-swift/pom.xml | 2 +- pmd-test-schema/pom.xml | 2 +- pmd-test/pom.xml | 2 +- pmd-tsql/pom.xml | 2 +- pmd-velocity/pom.xml | 2 +- pmd-visualforce/pom.xml | 2 +- pmd-xml/pom.xml | 2 +- pom.xml | 4 +- 46 files changed, 131 insertions(+), 105 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index fd664fbf41..9bb2dec84c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,9 +1,9 @@ repository: pmd/pmd pmd: - version: 7.2.0 - previous_version: 7.1.0 - date: 31-May-2024 + version: 7.3.0-SNAPSHOT + previous_version: 7.2.0 + date: 28-June-2024 release_type: minor # release types: major, minor, bugfix diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d4a701dd..e8d7cdbf90 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 -#### Collections exposed as XPath attributes - -Up to now, all AST node getters would be exposed to XPath, as long as the return type was a primitive (boxed or unboxed), String or Enum. That meant that collections, even of these basic types, were not exposed, so for instance accessing Apex's `ASTUserClass.getInterfaceNames()` to list the interfaces implemented by a class was impossible from XPath, and would require writing a Java rule to check it. - -Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` in Apex that implements `Queueable`, it is now possible to write: - -```xml -/UserClass[@InterfaceNames = 'Queueable'] -``` - -#### Updated PMD Designer - -This PMD release ships a new version of the pmd-designer. -For the changes, see [PMD Designer Changelog (7.2.0)](https://github.com/pmd/pmd-designer/releases/tag/7.2.0). - ### ๐Ÿ› Fixed Issues -* core - * [#4467](https://github.com/pmd/pmd/issues/4467): \[core] Expose collections from getters as XPath sequence attributes - * [#4978](https://github.com/pmd/pmd/issues/4978): \[core] Referenced Rulesets do not emit details on validation errors - * [#4983](https://github.com/pmd/pmd/pull/4983): \[cpd] Fix CPD crashes about unicode escapes - * [#5009](https://github.com/pmd/pmd/issues/5009): \[core] Kotest tests aren't picked up by surefire -* java - * [#4912](https://github.com/pmd/pmd/issues/4912): \[java] Unable to parse some Java9+ resource references - * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD - * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number - * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration - * [#4990](https://github.com/pmd/pmd/issues/4990): \[java] Add an attribute @PackageQualifier to ASTClassType - * [#5006](https://github.com/pmd/pmd/issues/5006): \[java] Bad intersection, unrelated class types Child and Parent - * [#5029](https://github.com/pmd/pmd/issues/5029): \[java] PMD 7.x throws stack overflow in TypeOps$ProjectionVisitor while parsing a Java class -* java-bestpractices - * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name - * [#4852](https://github.com/pmd/pmd/issues/4852): \[java] ReplaceVectorWithList false-positive (neither Vector nor List usage) - * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test - * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object -* java-codestyle - * [#1619](https://github.com/pmd/pmd/issues/1619): \[java] LocalVariableCouldBeFinal on 'size' variable in for loop - * [#3122](https://github.com/pmd/pmd/issues/3122): \[java] LocalVariableCouldBeFinal should consider blank local variables - * [#4903](https://github.com/pmd/pmd/issues/4903): \[java] UnnecessaryBoxing, but explicit conversion is necessary - * [#4924](https://github.com/pmd/pmd/issues/4924): \[java] UnnecessaryBoxing false positive in PMD 7.0.0 in lambda - * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources - * [#4954](https://github.com/pmd/pmd/issues/4954): \[java] LocalVariableNamingConventions should allow unnamed variables by default - * [#5028](https://github.com/pmd/pmd/issues/5028): \[java] FormalParameterNamingConventions should accept unnamed parameters by default -* java-errorprone - * [#4042](https://github.com/pmd/pmd/issues/4042): \[java] A false negative about the rule StringBufferInstantiationWithChar - * [#5007](https://github.com/pmd/pmd/issues/5007): \[java] AvoidUsingOctalValues triggers on non-octal double literals with a leading 0 -* java-multithreading - * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer ### ๐Ÿšจ API Changes -#### Deprecated API - -* pmd-java - * {% jdoc !!java::lang.java.ast.ASTResource#getStableName() %} and the corresponding attribute `@StableName` - ### โœจ External Contributions -* [#5020](https://github.com/pmd/pmd/issues/5020): \[java] Fix AvoidUsingOctalValues false-positive - [Gold856](https://github.com/Gold856) (@Gold856) - -### ๐Ÿ“ˆ Stats -* 152 commits -* 46 closed tickets & PRs -* Days since last release: 35 - {% endtocmaker %} + diff --git a/docs/pages/release_notes_old.md b/docs/pages/release_notes_old.md index b4eaab15bd..4bd8722d4a 100644 --- a/docs/pages/release_notes_old.md +++ b/docs/pages/release_notes_old.md @@ -5,6 +5,89 @@ permalink: pmd_release_notes_old.html Previous versions of PMD can be downloaded here: [Releases - pmd/pmd (GitHub)](https://github.com/pmd/pmd/releases) +## 31-May-2024 - 7.2.0 + +The PMD team is pleased to announce PMD 7.2.0. + +This is a minor release. + +### Table Of Contents + +* [๐Ÿš€ New and noteworthy](#new-and-noteworthy) + * [Collections exposed as XPath attributes](#collections-exposed-as-xpath-attributes) + * [Updated PMD Designer](#updated-pmd-designer) +* [๐Ÿ› Fixed Issues](#fixed-issues) +* [๐Ÿšจ API Changes](#api-changes) + * [Deprecated API](#deprecated-api) +* [โœจ External Contributions](#external-contributions) +* [๐Ÿ“ˆ Stats](#stats) + +### ๐Ÿš€ New and noteworthy + +#### Collections exposed as XPath attributes + +Up to now, all AST node getters would be exposed to XPath, as long as the return type was a primitive (boxed or unboxed), String or Enum. That meant that collections, even of these basic types, were not exposed, so for instance accessing Apex's `ASTUserClass.getInterfaceNames()` to list the interfaces implemented by a class was impossible from XPath, and would require writing a Java rule to check it. + +Since this release, PMD will also expose any getter returning a collection of any supported type as a sequence through an XPath attribute. They would require to use apropriate XQuery functions to manipulate the sequence. So for instance, to detect any given `ASTUserClass` in Apex that implements `Queueable`, it is now possible to write: + +```xml +/UserClass[@InterfaceNames = 'Queueable'] +``` + +#### Updated PMD Designer + +This PMD release ships a new version of the pmd-designer. +For the changes, see [PMD Designer Changelog (7.2.0)](https://github.com/pmd/pmd-designer/releases/tag/7.2.0). + +### ๐Ÿ› Fixed Issues +* core + * [#4467](https://github.com/pmd/pmd/issues/4467): \[core] Expose collections from getters as XPath sequence attributes + * [#4978](https://github.com/pmd/pmd/issues/4978): \[core] Referenced Rulesets do not emit details on validation errors + * [#4983](https://github.com/pmd/pmd/pull/4983): \[cpd] Fix CPD crashes about unicode escapes + * [#5009](https://github.com/pmd/pmd/issues/5009): \[core] Kotest tests aren't picked up by surefire +* java + * [#4912](https://github.com/pmd/pmd/issues/4912): \[java] Unable to parse some Java9+ resource references + * [#4973](https://github.com/pmd/pmd/pull/4973): \[java] Stop parsing Java for CPD + * [#4980](https://github.com/pmd/pmd/issues/4980): \[java] Bad intersection, unrelated class types java.lang.Object\[] and java.lang.Number + * [#4988](https://github.com/pmd/pmd/pull/4988): \[java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration + * [#4990](https://github.com/pmd/pmd/issues/4990): \[java] Add an attribute @PackageQualifier to ASTClassType + * [#5006](https://github.com/pmd/pmd/issues/5006): \[java] Bad intersection, unrelated class types Child and Parent + * [#5029](https://github.com/pmd/pmd/issues/5029): \[java] PMD 7.x throws stack overflow in TypeOps$ProjectionVisitor while parsing a Java class +* java-bestpractices + * [#4278](https://github.com/pmd/pmd/issues/4278): \[java] UnusedPrivateMethod FP with Junit 5 @MethodSource and default factory method name + * [#4852](https://github.com/pmd/pmd/issues/4852): \[java] ReplaceVectorWithList false-positive (neither Vector nor List usage) + * [#4975](https://github.com/pmd/pmd/issues/4975): \[java] UnusedPrivateMethod false positive when using @MethodSource on a @Nested test + * [#4985](https://github.com/pmd/pmd/issues/4985): \[java] UnusedPrivateMethod false-positive / method reference in combination with custom object +* java-codestyle + * [#1619](https://github.com/pmd/pmd/issues/1619): \[java] LocalVariableCouldBeFinal on 'size' variable in for loop + * [#3122](https://github.com/pmd/pmd/issues/3122): \[java] LocalVariableCouldBeFinal should consider blank local variables + * [#4903](https://github.com/pmd/pmd/issues/4903): \[java] UnnecessaryBoxing, but explicit conversion is necessary + * [#4924](https://github.com/pmd/pmd/issues/4924): \[java] UnnecessaryBoxing false positive in PMD 7.0.0 in lambda + * [#4930](https://github.com/pmd/pmd/issues/4930): \[java] EmptyControlStatement should not allow empty try with concise resources + * [#4954](https://github.com/pmd/pmd/issues/4954): \[java] LocalVariableNamingConventions should allow unnamed variables by default + * [#5028](https://github.com/pmd/pmd/issues/5028): \[java] FormalParameterNamingConventions should accept unnamed parameters by default +* java-errorprone + * [#4042](https://github.com/pmd/pmd/issues/4042): \[java] A false negative about the rule StringBufferInstantiationWithChar + * [#5007](https://github.com/pmd/pmd/issues/5007): \[java] AvoidUsingOctalValues triggers on non-octal double literals with a leading 0 +* java-multithreading + * [#2368](https://github.com/pmd/pmd/issues/2368): \[java] False positive UnsynchronizedStaticFormatter in static initializer + +### ๐Ÿšจ API Changes + +#### Deprecated API + +* pmd-java + * ASTResource#getStableName and the corresponding attribute `@StableName` + +### โœจ External Contributions + +* [#5020](https://github.com/pmd/pmd/issues/5020): \[java] Fix AvoidUsingOctalValues false-positive - [Gold856](https://github.com/Gold856) (@Gold856) + +### ๐Ÿ“ˆ Stats +* 152 commits +* 46 closed tickets & PRs +* Days since last release: 35 + ## 26-April-2024 - 7.1.0 The PMD team is pleased to announce PMD 7.1.0. diff --git a/pmd-ant/pom.xml b/pmd-ant/pom.xml index d28f7c06e4..dc93238cd3 100644 --- a/pmd-ant/pom.xml +++ b/pmd-ant/pom.xml @@ -7,7 +7,7 @@ pmd net.sourceforge.pmd - 7.2.0 + 7.3.0-SNAPSHOT 4.0.0 diff --git a/pmd-apex/pom.xml b/pmd-apex/pom.xml index 30d49d8f90..6346360e1d 100644 --- a/pmd-apex/pom.xml +++ b/pmd-apex/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml index 7eb3a5e724..e971574645 100644 --- a/pmd-cli/pom.xml +++ b/pmd-cli/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-coco/pom.xml b/pmd-coco/pom.xml index ee14507e27..bb12f86503 100644 --- a/pmd-coco/pom.xml +++ b/pmd-coco/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-compat6/pom.xml b/pmd-compat6/pom.xml index 09bff36dab..cf0c893b26 100644 --- a/pmd-compat6/pom.xml +++ b/pmd-compat6/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT pmd-compat6 diff --git a/pmd-core/pom.xml b/pmd-core/pom.xml index f1c7b1e86d..b5140a25fa 100644 --- a/pmd-core/pom.xml +++ b/pmd-core/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-cpp/pom.xml b/pmd-cpp/pom.xml index 2354bee920..9c430cc4f4 100644 --- a/pmd-cpp/pom.xml +++ b/pmd-cpp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-cs/pom.xml b/pmd-cs/pom.xml index b35ff6d715..026de2bee2 100644 --- a/pmd-cs/pom.xml +++ b/pmd-cs/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-dart/pom.xml b/pmd-dart/pom.xml index 5c5c1e9996..47d2c87ad6 100644 --- a/pmd-dart/pom.xml +++ b/pmd-dart/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 649d40f25e..9f8e02fdf8 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-doc/pom.xml b/pmd-doc/pom.xml index 72323c14e6..7ebb6d3d00 100644 --- a/pmd-doc/pom.xml +++ b/pmd-doc/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-fortran/pom.xml b/pmd-fortran/pom.xml index 7b7040bcb9..86e87edcb9 100644 --- a/pmd-fortran/pom.xml +++ b/pmd-fortran/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-gherkin/pom.xml b/pmd-gherkin/pom.xml index 6c06886317..a62a575cda 100644 --- a/pmd-gherkin/pom.xml +++ b/pmd-gherkin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-go/pom.xml b/pmd-go/pom.xml index 477c14aa8d..d69f0d58af 100644 --- a/pmd-go/pom.xml +++ b/pmd-go/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-groovy/pom.xml b/pmd-groovy/pom.xml index 5c405f30d7..a700b821d9 100644 --- a/pmd-groovy/pom.xml +++ b/pmd-groovy/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-html/pom.xml b/pmd-html/pom.xml index 7d5318fa66..223deed571 100644 --- a/pmd-html/pom.xml +++ b/pmd-html/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-java/pom.xml b/pmd-java/pom.xml index 9f5dfd0fdb..ea6d0daefb 100644 --- a/pmd-java/pom.xml +++ b/pmd-java/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-javascript/pom.xml b/pmd-javascript/pom.xml index d1c674e8b6..4fa7fda466 100644 --- a/pmd-javascript/pom.xml +++ b/pmd-javascript/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-jsp/pom.xml b/pmd-jsp/pom.xml index f80e5143eb..68d2a90afb 100644 --- a/pmd-jsp/pom.xml +++ b/pmd-jsp/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-julia/pom.xml b/pmd-julia/pom.xml index f6db428b5a..bf449e6a41 100644 --- a/pmd-julia/pom.xml +++ b/pmd-julia/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-kotlin/pom.xml b/pmd-kotlin/pom.xml index d437e231ff..47bb2e54d2 100644 --- a/pmd-kotlin/pom.xml +++ b/pmd-kotlin/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-lang-test/pom.xml b/pmd-lang-test/pom.xml index 1bff3ef16d..a4a634f09c 100644 --- a/pmd-lang-test/pom.xml +++ b/pmd-lang-test/pom.xml @@ -12,7 +12,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml index 93512a36c3..501f61a841 100644 --- a/pmd-languages-deps/pom.xml +++ b/pmd-languages-deps/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT pmd-languages-deps diff --git a/pmd-lua/pom.xml b/pmd-lua/pom.xml index 9f7228936a..23834ba393 100644 --- a/pmd-lua/pom.xml +++ b/pmd-lua/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-matlab/pom.xml b/pmd-matlab/pom.xml index 288d5d08bd..4b4e840b74 100644 --- a/pmd-matlab/pom.xml +++ b/pmd-matlab/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-modelica/pom.xml b/pmd-modelica/pom.xml index 09033b979d..5ee4d15a7a 100644 --- a/pmd-modelica/pom.xml +++ b/pmd-modelica/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-objectivec/pom.xml b/pmd-objectivec/pom.xml index 1dd7bf0a7e..3dab6880c0 100644 --- a/pmd-objectivec/pom.xml +++ b/pmd-objectivec/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-perl/pom.xml b/pmd-perl/pom.xml index 9b5d15fb31..e2a21f93ac 100644 --- a/pmd-perl/pom.xml +++ b/pmd-perl/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-php/pom.xml b/pmd-php/pom.xml index 08e86b38e8..1d98f18865 100644 --- a/pmd-php/pom.xml +++ b/pmd-php/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-plsql/pom.xml b/pmd-plsql/pom.xml index 29cc36da7f..f94aa65cfd 100644 --- a/pmd-plsql/pom.xml +++ b/pmd-plsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-python/pom.xml b/pmd-python/pom.xml index 3458ee1e81..1096c0ee06 100644 --- a/pmd-python/pom.xml +++ b/pmd-python/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-ruby/pom.xml b/pmd-ruby/pom.xml index 8885449b2f..605c3a4221 100644 --- a/pmd-ruby/pom.xml +++ b/pmd-ruby/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.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 17e30ae260..c7f99d9081 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 - 7.2.0 + 7.3.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 3520f2de37..a217eb5904 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 - 7.2.0 + 7.3.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 a43cd14e21..7df4503d28 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 - 7.2.0 + 7.3.0-SNAPSHOT ../pmd-scala-common/pom.xml diff --git a/pmd-swift/pom.xml b/pmd-swift/pom.xml index 68044d16ba..73f00c27bf 100644 --- a/pmd-swift/pom.xml +++ b/pmd-swift/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-test-schema/pom.xml b/pmd-test-schema/pom.xml index bed7f20233..4e622b3c43 100644 --- a/pmd-test-schema/pom.xml +++ b/pmd-test-schema/pom.xml @@ -11,7 +11,7 @@ pmd net.sourceforge.pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-test/pom.xml b/pmd-test/pom.xml index 11bc0c3d77..9d8a9d9ec7 100644 --- a/pmd-test/pom.xml +++ b/pmd-test/pom.xml @@ -8,7 +8,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-tsql/pom.xml b/pmd-tsql/pom.xml index 6914974413..e76c560cb6 100644 --- a/pmd-tsql/pom.xml +++ b/pmd-tsql/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-velocity/pom.xml b/pmd-velocity/pom.xml index 4f6ba4e332..ce1dd8f862 100644 --- a/pmd-velocity/pom.xml +++ b/pmd-velocity/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-visualforce/pom.xml b/pmd-visualforce/pom.xml index bd93ce3b36..b2c0986219 100644 --- a/pmd-visualforce/pom.xml +++ b/pmd-visualforce/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pmd-xml/pom.xml b/pmd-xml/pom.xml index a89b017a42..1de90d9424 100644 --- a/pmd-xml/pom.xml +++ b/pmd-xml/pom.xml @@ -7,7 +7,7 @@ net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 5c340318fc..f78eeeb404 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 net.sourceforge.pmd pmd - 7.2.0 + 7.3.0-SNAPSHOT pom PMD @@ -62,7 +62,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/7.2.0 + HEAD From 48512a43f6b637c8846376149f016bfed616142e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Wed, 5 Jun 2024 12:38:20 +0200 Subject: [PATCH 111/121] Fix #5047 - type inference with enum --- .../pmd/lang/java/types/TypeOps.java | 2 +- .../types/internal/infer/InferenceVar.java | 2 +- .../types/internal/infer/TypeInferenceTest.kt | 47 ++++++++++++ .../bestpractices/xml/UnusedPrivateMethod.xml | 72 +++++++++++++++++++ 4 files changed, 121 insertions(+), 2 deletions(-) diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java index 66f237ae61..051ea91c02 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/TypeOps.java @@ -218,7 +218,7 @@ public final class TypeOps { @Override public Boolean visitInferenceVar(InferenceVar t, JTypeMirror s) { if (pure) { - return t == s; + return t == s || t.getBounds(BoundKind.EQ).contains(s); } if (s instanceof JPrimitiveType) { diff --git a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java index cf5a71ea5c..abfbc904c1 100644 --- a/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java +++ b/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java @@ -79,7 +79,7 @@ public final class InferenceVar implements SubstVar { * Returns the bounds of a certain kind that apply to * this variable. */ - Set getBounds(BoundKind kind) { + public Set getBounds(BoundKind kind) { return boundSet.bounds.getOrDefault(kind, Collections.emptySet()); } diff --git a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt index d877ef1b2c..0808d950cf 100644 --- a/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt +++ b/pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/TypeInferenceTest.kt @@ -407,4 +407,51 @@ public class BadIntersection { acu.firstMethodCall() shouldHaveType java.util.List::class[t_Animal] } } + parserTest("#5047 inference failed with enum") { + val (acu, spy) = parser.parseWithTypeInferenceSpy( + """ + interface Function { R apply(T t); } + + public class Main { + public enum OptOutStatus { + UNKNOWN_STATUS(3L); + + private final long id; + + OptOutStatus(long id) { + this.id = id; + } + + public long id() { + return this.id; + } + } + + static class Utils { + private Long getValue(OptOutStatus val) { + return getValue(val, OptOutStatus::id); + } + + private > Long getValue(T enumValue, Function fn) { + if (enumValue == null) { + return null; + } + return fn.apply(enumValue); + } + } + } + + """.trimIndent() + ) + + val (_, _, optOutEnum) = acu.declaredTypeSignatures() + val (_, getValue2) = acu.methodDeclarations().filter { it.name == "getValue" }.toList() + + spy.shouldBeOk { + val info = acu.firstMethodCall().overloadSelectionInfo + info::isFailed shouldBe false + info.methodType shouldBeSomeInstantiationOf getValue2.genericSignature + info.methodType.formalParameters[0] shouldBe optOutEnum + } + } }) diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml index 41367ff29f..5f2871d3dc 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml @@ -2002,4 +2002,76 @@ class FooTest{ } ]]> + + UnusedPrivateMethod for Generics and Overloads #5047 + 0 + > Long getValue(T enumValue, Function fn) { + if (enumValue == null) { + return null; + } + return fn.apply(enumValue); + } + } + } + ]]> + From 57c26dd49b380911839a65801a55249f3d703259 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 24 May 2024 14:47:22 +0200 Subject: [PATCH 112/121] Update kotest and kotlin - Bumps kotest from 5.5.5 to 5.9.0 - Bumps kotlin from 1.7.20 to 1.9.24 - Bumps dokka from 1.7.20 to 1.9.20 --- pom.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f78eeeb404..c3e41f7588 100644 --- a/pom.xml +++ b/pom.xml @@ -92,10 +92,10 @@ ${maven.compiler.test.target} - 1.7.20 - 5.5.5 + 1.9.24 + 5.9.0 5.8.2 - 1.7.20 + 1.9.20 5.0 3.2.5 @@ -335,7 +335,11 @@ alphabetical + ${project.build.testResources[0].directory} + + true + true true From a0e7bd739018843339a62f9ea4eb3c9f43763952 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 6 Jun 2024 16:35:29 +0200 Subject: [PATCH 113/121] Bump kotest from 5.9.0 to 5.9.1 https://github.com/kotest/kotest/releases/tag/v5.9.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3e41f7588..393f3b7ee7 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ ${maven.compiler.test.target} 1.9.24 - 5.9.0 + 5.9.1 5.8.2 1.9.20 From 72bf5d07b421bef9a38f83ce179dc92e634f9395 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 7 Jun 2024 11:20:50 +0200 Subject: [PATCH 114/121] [plsql] Support MERGE statement Fixes #1934 --- docs/pages/release_notes.md | 2 + pmd-plsql/etc/grammar/PLSQL.jjt | 107 ++++++++++++++--- .../pmd/lang/plsql/ast/PlsqlTreeDumpTest.java | 5 + .../plsql/ast/MergeStatementIssue1934.pls | 17 +++ .../plsql/ast/MergeStatementIssue1934.txt | 108 ++++++++++++++++++ 5 files changed, 220 insertions(+), 19 deletions(-) create mode 100644 pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls create mode 100644 pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d7cdbf90..48fbdf1007 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 +* plsql + * [#1934](https://github.com/pmd/pmd/issues/1934): \[plsql] ParseException with MERGE statement in anonymous block ### ๐Ÿšจ API Changes diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index 5108997fac..f7a49d95c9 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -27,6 +27,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** + * Add support for MERGE (INTO) statement + * + * Andreas Dangel 06/2024 + *==================================================================== * Add support for Select statement within OPEN FOR Statements * * Andreas Dangel 09/2021 @@ -293,7 +297,8 @@ ASTInput Input() : | DeleteStatement() [";"] | InsertStatement() [";"] | SelectStatement() [";"] - |(|||||) ReadPastNextOccurrence(";") //Ignore SQL statements in scripts + | MergeStatement() [";"] + |(|||
|) ReadPastNextOccurrence(";") //Ignore SQL statements in scripts ) ("/")* )* @@ -1078,19 +1083,32 @@ void Skip2NextTerminator(String initiator,String terminator) : if(t.getImage().equals(initiator)) count++; while (count > 0 || !t.getImage().equals(terminator)) { - t = getNextToken(); - t = getToken(1); - if(t.getImage().equals(initiator)) count++; - if(t.getImage().equals(terminator)) count--; - if((null != t.specialToken && beginToken.kind != SELECT && beginToken.kind != INSERT && beginToken.kind != UPDATE && beginToken.kind != DELETE - && beginToken.kind != MERGE && beginToken.kind != EXECUTE && beginToken.kind != WITH) || t.kind == EOF) - return; - if (t.specialToken != null && "/".equals(t.getImage())) - return; + t = getNextToken(); + t = getToken(1); + if (t.getImage().equals(initiator)) { + count++; + } + if (t.getImage().equals(terminator)) { + count--; + } + if ((null != t.specialToken + && beginToken.kind != SELECT + && beginToken.kind != INSERT + && beginToken.kind != UPDATE + && beginToken.kind != DELETE + && beginToken.kind != MERGE + && beginToken.kind != EXECUTE + && beginToken.kind != WITH) + || t.kind == EOF) { + return; + } + if (t.specialToken != null && "/".equals(t.getImage())) { + return; + } } } { - { return; } + { return; } } /* @@ -1256,10 +1274,10 @@ ASTSqlStatement SqlStatement(String initiator, String terminator) : |
{jjtThis.setType(ASTSqlStatement.Type.LOCK_TABLE); } |{jjtThis.setType(ASTSqlStatement.Type.MERGE); } |) - Skip2NextTerminator(initiator, terminator) - { - return jjtThis ; - } + Skip2NextTerminator(initiator, terminator) + { + return jjtThis; + } } void AbstractSelectStatement(AbstractSelectStatement node) #void : @@ -2346,6 +2364,7 @@ ASTUnlabelledStatement UnlabelledStatement() : UpdateStatement() ";" | DeleteStatement() ";" | InsertStatement() ";" | + LOOKAHEAD(2) MergeStatement() ";" | LOOKAHEAD(["("]
||) SqlStatement(null,";") [";"] | LOOKAHEAD(3) ContinueStatement() ";" // CONTINUE keyword was added in 11G, so Oracle compilation supports CONTINUE as a variable name | CaseStatement() ";" @@ -2654,6 +2673,55 @@ ASTDeleteStatement DeleteStatement() : { return jjtThis; } } +/** + * https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/MERGE.html#GUID-5692CCB7-24D9-4C0E-81A7-A22436DC968F + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/MERGE.html#GUID-5692CCB7-24D9-4C0E-81A7-A22436DC968F + */ +ASTMergeStatement MergeStatement() : +{} +{ + [ LOOKAHEAD(2) SchemaName() "." ] TableName() [ TableAlias() ] + + ( + LOOKAHEAD(3) "(" ValuesClause() ")" + | "(" Subquery() ")" [ TableAlias() ] + | [ LOOKAHEAD(2) SchemaName() "." ] TableName() [ TableAlias() ] + ) + "(" Condition() ")" + [ LOOKAHEAD(MergeUpdateClausePrefix()) MergeUpdateClause() ] + [ LOOKAHEAD(2) MergeInsertClause() ] + [ ErrorLoggingClause() ] + [ ReturningClause() ] + { return jjtThis; } +} + +void MergeUpdateClausePrefix() #void: +{} +{ + KEYWORD("MATCHED") +} + +ASTMergeUpdateClause MergeUpdateClause() : +{} +{ + MergeUpdateClausePrefix() + [ LOOKAHEAD(2) TableName() "." ] Column() "=" ( LOOKAHEAD(2) "(" Subquery() ")" | Expression() | <_DEFAULT> ) + ( "," [ LOOKAHEAD(2) TableName() "." ] Column() "=" ( LOOKAHEAD(2) "(" Subquery() ")" | Expression() | <_DEFAULT> ) )* + [ WhereClause() ] + [ WhereClause() ] + { return jjtThis; } +} + +ASTMergeInsertClause MergeInsertClause() : +{} +{ + KEYWORD("MATCHED") + [ "(" Column() ( "," Column() )* ")" ] + ValuesClause() + [ WhereClause() ] + { return jjtThis; } +} + /** Scope rule: the loop index only exists within the Loop */ ASTForStatement ForStatement() : {} @@ -5426,14 +5494,15 @@ void RESERVED_WORD() #void: {} void KEYWORD(String id) #void: {} { - { - if (!token.getImage().equalsIgnoreCase(id)) { + if (!isKeyword(id)) { String eol = System.getProperty("line.separator", "\n"); - throw new ParseException("Encountered \"" + token.getImage() + "\" " - + "Was expecting: " + id).withLocation(token); + throw new ParseException("Encountered \"" + getToken(1).getImage() + "\" " + + "Was expecting: \"" + id + "\"").withLocation(token); } } + + } ASTKEYWORD_UNRESERVED KEYWORD_UNRESERVED (): {} diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java index 438184c677..5a49292182 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java @@ -41,4 +41,9 @@ class PlsqlTreeDumpTest extends BaseTreeDumpTest { void parseSelectIntoAssociativeArrayType() { doTest("SelectIntoArray"); } + + @Test + void parseMergeStatement() { + doTest("MergeStatementIssue1934"); + } } diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls new file mode 100644 index 0000000000..555f439f0b --- /dev/null +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls @@ -0,0 +1,17 @@ +-- +-- BSD-style license; for more info see http://pmd.sourceforge.net/license.html +-- + +-- See https://github.com/pmd/pmd/issues/1934 + +BEGIN + + MERGE INTO jhs_translations b + USING ( SELECT 'PROM_EDIT_PROM_NR' key1,'Edycja promocji nr' text,123123 lce_id FROM dual ) e + ON (b.key1 = e.key1 and b.lce_id=e.lce_id) + WHEN MATCHED + THEN UPDATE SET b.text = e.text + WHEN NOT MATCHED + THEN INSERT (ID,KEY1, TEXT,LCE_ID) values (JHS_SEQ.NEXTVAL,'PROM_EDIT_PROM_NR','Edycja promocji nr',123123); +END; +/ diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt new file mode 100644 index 0000000000..c473d6143c --- /dev/null +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt @@ -0,0 +1,108 @@ ++- Input[@CanonicalImage = null, @ExcludedLinesCount = 0, @ExcludedRangesCount = 0] + +- Global[@CanonicalImage = null] + +- Block[@CanonicalImage = null] + +- Statement[@CanonicalImage = null] + +- UnlabelledStatement[@CanonicalImage = null] + +- MergeStatement[@CanonicalImage = null] + +- TableName[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] + | +- ID[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] + +- TableAlias[@CanonicalImage = "B", @Image = "b"] + | +- ID[@CanonicalImage = "B", @Image = "b"] + +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] + | +- SelectList[@CanonicalImage = null] + | | +- SqlExpression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + | | +- ColumnAlias[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | +- SqlExpression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + | | +- ColumnAlias[@CanonicalImage = "TEXT", @Image = "text"] + | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | | +- SqlExpression[@CanonicalImage = "123123", @Image = "123123"] + | | | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + | | | +- Literal[@CanonicalImage = "123123", @Image = "123123"] + | | | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] + | | +- ColumnAlias[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | +- FromClause[@CanonicalImage = null] + | +- TableReference[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "DUAL", @Image = "dual"] + | +- ID[@CanonicalImage = "DUAL", @Image = "dual"] + +- TableAlias[@CanonicalImage = "E", @Image = "e"] + | +- ID[@CanonicalImage = "E", @Image = "e"] + +- Condition[@CanonicalImage = null] + | +- CompoundCondition[@CanonicalImage = null, @Type = "AND"] + | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | +- SqlExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | +- PrimaryPrefix[@CanonicalImage = "B.KEY1", @Image = "b.key1", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | +- SqlExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | +- PrimaryPrefix[@CanonicalImage = "E.KEY1", @Image = "e.key1", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | +- Condition[@CanonicalImage = null] + | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | +- SqlExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | +- PrimaryPrefix[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | +- SqlExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | +- PrimaryPrefix[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id", @SelfModifier = false] + | +- SimpleExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | +- ID[@CanonicalImage = "E", @Image = "e"] + | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + +- MergeUpdateClause[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | +- ID[@CanonicalImage = "B", @Image = "b"] + | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | +- Expression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | +- PrimaryPrefix[@CanonicalImage = "E.TEXT", @Image = "e.text", @SelfModifier = false] + | +- SimpleExpression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | +- ID[@CanonicalImage = "E", @Image = "e"] + | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + +- MergeInsertClause[@CanonicalImage = null] + +- Column[@CanonicalImage = "ID", @Image = "ID"] + | +- ID[@CanonicalImage = "ID", @Image = "ID"] + +- Column[@CanonicalImage = "KEY1", @Image = "KEY1"] + | +- ID[@CanonicalImage = "KEY1", @Image = "KEY1"] + +- Column[@CanonicalImage = "TEXT", @Image = "TEXT"] + | +- ID[@CanonicalImage = "TEXT", @Image = "TEXT"] + +- Column[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + | +- ID[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + +- ValuesClause[@CanonicalImage = null] + +- Expression[@CanonicalImage = "", @Image = ""] + | +- PrimaryPrefix[@CanonicalImage = "", @Image = "", @SelfModifier = false] + | +- SimpleExpression[@CanonicalImage = "", @Image = ""] + | +- ID[@CanonicalImage = "JHS_SEQ", @Image = "JHS_SEQ"] + +- Expression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + +- Expression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + +- Expression[@CanonicalImage = "123123", @Image = "123123"] + +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + +- Literal[@CanonicalImage = "123123", @Image = "123123"] + +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] From d47ca10029a2b851a10aebddbb652d78c5644fe8 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 7 Jun 2024 12:16:43 +0200 Subject: [PATCH 115/121] [plsql] Support Error Logging in INSERT, UPDATE, DELETE Fixes #2779 --- docs/pages/release_notes.md | 2 + pmd-plsql/etc/grammar/PLSQL.jjt | 21 ++- .../pmd/lang/plsql/ast/PlsqlTreeDumpTest.java | 5 + .../lang/plsql/ast/ErrorLoggingClause2779.pls | 29 ++++ .../lang/plsql/ast/ErrorLoggingClause2779.txt | 149 ++++++++++++++++++ 5 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.pls create mode 100644 pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.txt diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d7cdbf90..9ede3ce465 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 +* plsql + * [#2779](https://github.com/pmd/pmd/issues/2779): \[plsql] Error while parsing statement with (Oracle) DML Error Logging ### ๐Ÿšจ API Changes diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index 5108997fac..25a1033d2f 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -27,6 +27,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** + * Add support Error Logging for INSERT, UPDATE, DELETE + * + * Andreas Dangel 06/2024 + *==================================================================== * Add support for Select statement within OPEN FOR Statements * * Andreas Dangel 09/2021 @@ -2087,7 +2091,7 @@ ASTTableReference TableReference() : { QueryTableExpression() - [ LOOKAHEAD(2) TableAlias() ] + [ LOOKAHEAD(2, {!getToken(1).getImage().equalsIgnoreCase("LOG")}) TableAlias() ] { return jjtThis; } } @@ -2457,7 +2461,7 @@ ASTCursorForLoopStatement CursorForLoopStatement() : } /** - * See https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/INSERT.html#GUID-903F8043-0254-4EE9-ACC1-CB8AC0AF3423 + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html#GUID-903F8043-0254-4EE9-ACC1-CB8AC0AF3423 */ ASTInsertStatement InsertStatement() : {} @@ -2470,6 +2474,7 @@ ASTSingleTableInsert SingleTableInsert() : {} { InsertIntoClause() ( ValuesClause() [ ReturningClause() ] | Subquery() ) + [ ErrorLoggingClause() ] { return jjtThis; } } @@ -2622,7 +2627,8 @@ ASTUpdateSetClause UpdateSetClause() : } /** - * https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/UPDATE.html#GUID-027A462D-379D-4E35-8611-410F3AC8FDA5__I2126358 + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html#GUID-027A462D-379D-4E35-8611-410F3AC8FDA5__I2126358 + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html#GUID-156845A5-B626-412B-9F95-8869B988ABD7__I2122564 */ ASTReturningClause ReturningClause() : {} @@ -2632,7 +2638,9 @@ ASTReturningClause ReturningClause() : } /** - * https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/UPDATE.html#GUID-027A462D-379D-4E35-8611-410F3AC8FDA5__BCEEAAGC + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html#GUID-903F8043-0254-4EE9-ACC1-CB8AC0AF3423__BGBDIGAH + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html#GUID-027A462D-379D-4E35-8611-410F3AC8FDA5__BCEEAAGC + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html#GUID-156845A5-B626-412B-9F95-8869B988ABD7__CEGCHDJF */ ASTErrorLoggingClause ErrorLoggingClause() : {} @@ -2645,12 +2653,17 @@ ASTErrorLoggingClause ErrorLoggingClause() : } +/** + * https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/DELETE.html#GUID-156845A5-B626-412B-9F95-8869B988ABD7 + */ ASTDeleteStatement DeleteStatement() : {} { [ ] ( TableReference() | "(" TableReference() ")" ) [ WhereClause() ] + [ ReturningClause() ] + [ ErrorLoggingClause() ] { return jjtThis; } } diff --git a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java index 438184c677..45612111c7 100644 --- a/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java +++ b/pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/PlsqlTreeDumpTest.java @@ -41,4 +41,9 @@ class PlsqlTreeDumpTest extends BaseTreeDumpTest { void parseSelectIntoAssociativeArrayType() { doTest("SelectIntoArray"); } + + @Test + void errorLoggingClause() { + doTest("ErrorLoggingClause2779"); + } } diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.pls b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.pls new file mode 100644 index 0000000000..580a396391 --- /dev/null +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.pls @@ -0,0 +1,29 @@ +-- +-- BSD-style license; for more info see http://pmd.sourceforge.net/license.html +-- + +create or replace procedure test as +begin + + -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/INSERT.html#GUID-903F8043-0254-4EE9-ACC1-CB8AC0AF3423__BCEGDJDJ + INSERT INTO raises + SELECT employee_id, salary*1.1 FROM employees + WHERE commission_pct > .2 + LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10; + + -- https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/UPDATE.html#GUID-027A462D-379D-4E35-8611-410F3AC8FDA5__I2135485 + UPDATE people_demo1 p SET VALUE(p) = + (SELECT VALUE(q) FROM people_demo2 q + WHERE p.department_id = q.department_id) + WHERE p.department_id = 10 + LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10; + + -- https://github.com/pmd/pmd/issues/2779 + delete from test_table talias + log errors into err$_test_table reject limit unlimited; + + -- without a table alias + delete from test_table + log errors into err$_test_table reject limit unlimited; +end; +/ diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.txt new file mode 100644 index 0000000000..ce2cf4c5e2 --- /dev/null +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ErrorLoggingClause2779.txt @@ -0,0 +1,149 @@ ++- Input[@CanonicalImage = null, @ExcludedLinesCount = 0, @ExcludedRangesCount = 0] + +- Global[@CanonicalImage = null] + +- ProgramUnit[@CanonicalImage = null, @MethodName = "test", @Name = "test", @ObjectName = null] + +- MethodDeclarator[@CanonicalImage = "TEST", @Image = "test", @ParameterCount = 1] + | +- ObjectNameDeclaration[@CanonicalImage = "TEST", @Image = "test"] + | +- ID[@CanonicalImage = "TEST", @Image = "test"] + +- DeclarativeSection[@CanonicalImage = null] + +- Statement[@CanonicalImage = null] + | +- UnlabelledStatement[@CanonicalImage = null] + | +- InsertStatement[@CanonicalImage = null] + | +- SingleTableInsert[@CanonicalImage = null] + | +- InsertIntoClause[@CanonicalImage = null] + | | +- DMLTableExpressionClause[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "RAISES", @Image = "raises"] + | | +- ID[@CanonicalImage = "RAISES", @Image = "raises"] + | +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] + | | +- SelectList[@CanonicalImage = null] + | | | +- SqlExpression[@CanonicalImage = "EMPLOYEE_ID", @Image = "employee_id"] + | | | | +- PrimaryPrefix[@CanonicalImage = "EMPLOYEE_ID", @Image = "employee_id", @SelfModifier = false] + | | | | +- SimpleExpression[@CanonicalImage = "EMPLOYEE_ID", @Image = "employee_id"] + | | | | +- Column[@CanonicalImage = "EMPLOYEE_ID", @Image = "employee_id"] + | | | | +- ID[@CanonicalImage = "EMPLOYEE_ID", @Image = "employee_id"] + | | | +- SqlExpression[@CanonicalImage = "SALARY * 1.1", @Image = "salary * 1.1"] + | | | +- MultiplicativeExpression[@CanonicalImage = "SALARY * 1.1", @Image = "salary * 1.1"] + | | | +- PrimaryPrefix[@CanonicalImage = "SALARY", @Image = "salary", @SelfModifier = false] + | | | | +- SimpleExpression[@CanonicalImage = "SALARY", @Image = "salary"] + | | | | +- Column[@CanonicalImage = "SALARY", @Image = "salary"] + | | | | +- ID[@CanonicalImage = "SALARY", @Image = "salary"] + | | | +- PrimaryPrefix[@CanonicalImage = "1.1", @Image = "1.1", @SelfModifier = false] + | | | +- Literal[@CanonicalImage = "1.1", @Image = "1.1"] + | | | +- NumericLiteral[@CanonicalImage = "1.1", @Image = "1.1"] + | | +- FromClause[@CanonicalImage = null] + | | | +- TableReference[@CanonicalImage = null] + | | | +- TableName[@CanonicalImage = "EMPLOYEES", @Image = "employees"] + | | | +- ID[@CanonicalImage = "EMPLOYEES", @Image = "employees"] + | | +- WhereClause[@CanonicalImage = null] + | | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = ">"] + | | +- SqlExpression[@CanonicalImage = "COMMISSION_PCT", @Image = "commission_pct"] + | | | +- PrimaryPrefix[@CanonicalImage = "COMMISSION_PCT", @Image = "commission_pct", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "COMMISSION_PCT", @Image = "commission_pct"] + | | | +- Column[@CanonicalImage = "COMMISSION_PCT", @Image = "commission_pct"] + | | | +- ID[@CanonicalImage = "COMMISSION_PCT", @Image = "commission_pct"] + | | +- SqlExpression[@CanonicalImage = ".2", @Image = ".2"] + | | +- PrimaryPrefix[@CanonicalImage = ".2", @Image = ".2", @SelfModifier = false] + | | +- Literal[@CanonicalImage = ".2", @Image = ".2"] + | | +- NumericLiteral[@CanonicalImage = ".2", @Image = ".2"] + | +- ErrorLoggingClause[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "ERRLOG", @Image = "errlog"] + | | +- ID[@CanonicalImage = "ERRLOG", @Image = "errlog"] + | +- SqlExpression[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'"] + | | +- StringLiteral[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'", @String = "my_bad"] + | +- NumericLiteral[@CanonicalImage = "10", @Image = "10"] + +- Statement[@CanonicalImage = null] + | +- UnlabelledStatement[@CanonicalImage = null] + | +- UpdateStatement[@CanonicalImage = null] + | +- DMLTableExpressionClause[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "PEOPLE_DEMO1", @Image = "people_demo1"] + | | +- ID[@CanonicalImage = "PEOPLE_DEMO1", @Image = "people_demo1"] + | +- TableAlias[@CanonicalImage = "P", @Image = "p"] + | | +- ID[@CanonicalImage = "P", @Image = "p"] + | +- UpdateSetClause[@CanonicalImage = null] + | | +- TableAlias[@CanonicalImage = "P", @Image = "p"] + | | | +- ID[@CanonicalImage = "P", @Image = "p"] + | | +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] + | | +- SelectList[@CanonicalImage = null] + | | | +- SqlExpression[@CanonicalImage = "VALUE", @Image = "VALUE"] + | | | +- PrimaryPrefix[@CanonicalImage = "VALUE", @Image = "VALUE", @SelfModifier = false] + | | | +- FunctionCall[@CanonicalImage = "VALUE", @Image = "VALUE"] + | | | +- FunctionName[@CanonicalImage = "VALUE", @Image = "VALUE"] + | | | | +- ID[@CanonicalImage = "VALUE", @Image = "VALUE"] + | | | +- Arguments[@ArgumentCount = 1, @CanonicalImage = null] + | | | +- ArgumentList[@CanonicalImage = null] + | | | +- Argument[@CanonicalImage = null] + | | | +- Expression[@CanonicalImage = "Q", @Image = "q"] + | | | +- PrimaryPrefix[@CanonicalImage = "Q", @Image = "q", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "Q", @Image = "q"] + | | | +- Column[@CanonicalImage = "Q", @Image = "q"] + | | | +- ID[@CanonicalImage = "Q", @Image = "q"] + | | +- FromClause[@CanonicalImage = null] + | | | +- TableReference[@CanonicalImage = null] + | | | +- TableName[@CanonicalImage = "PEOPLE_DEMO2", @Image = "people_demo2"] + | | | | +- ID[@CanonicalImage = "PEOPLE_DEMO2", @Image = "people_demo2"] + | | | +- TableAlias[@CanonicalImage = "Q", @Image = "q"] + | | | +- ID[@CanonicalImage = "Q", @Image = "q"] + | | +- WhereClause[@CanonicalImage = null] + | | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | +- SqlExpression[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id"] + | | | +- PrimaryPrefix[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id"] + | | | +- TableName[@CanonicalImage = "P", @Image = "p"] + | | | | +- ID[@CanonicalImage = "P", @Image = "p"] + | | | +- Column[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | | | +- ID[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | | +- SqlExpression[@CanonicalImage = "Q.DEPARTMENT_ID", @Image = "q.department_id"] + | | +- PrimaryPrefix[@CanonicalImage = "Q.DEPARTMENT_ID", @Image = "q.department_id", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "Q.DEPARTMENT_ID", @Image = "q.department_id"] + | | +- TableName[@CanonicalImage = "Q", @Image = "q"] + | | | +- ID[@CanonicalImage = "Q", @Image = "q"] + | | +- Column[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | | +- ID[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | +- WhereClause[@CanonicalImage = null] + | | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | +- SqlExpression[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id"] + | | | +- PrimaryPrefix[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "P.DEPARTMENT_ID", @Image = "p.department_id"] + | | | +- TableName[@CanonicalImage = "P", @Image = "p"] + | | | | +- ID[@CanonicalImage = "P", @Image = "p"] + | | | +- Column[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | | | +- ID[@CanonicalImage = "DEPARTMENT_ID", @Image = "department_id"] + | | +- SqlExpression[@CanonicalImage = "10", @Image = "10"] + | | +- PrimaryPrefix[@CanonicalImage = "10", @Image = "10", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "10", @Image = "10"] + | | +- NumericLiteral[@CanonicalImage = "10", @Image = "10"] + | +- ErrorLoggingClause[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "ERRLOG", @Image = "errlog"] + | | +- ID[@CanonicalImage = "ERRLOG", @Image = "errlog"] + | +- SqlExpression[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'"] + | | +- StringLiteral[@CanonicalImage = "\'MY_BAD\'", @Image = "\'my_bad\'", @String = "my_bad"] + | +- NumericLiteral[@CanonicalImage = "10", @Image = "10"] + +- Statement[@CanonicalImage = null] + | +- UnlabelledStatement[@CanonicalImage = null] + | +- DeleteStatement[@CanonicalImage = null] + | +- TableReference[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "TEST_TABLE", @Image = "test_table"] + | | | +- ID[@CanonicalImage = "TEST_TABLE", @Image = "test_table"] + | | +- TableAlias[@CanonicalImage = "TALIAS", @Image = "talias"] + | | +- ID[@CanonicalImage = "TALIAS", @Image = "talias"] + | +- ErrorLoggingClause[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "ERR$_TEST_TABLE", @Image = "err$_test_table"] + | +- ID[@CanonicalImage = "ERR$_TEST_TABLE", @Image = "err$_test_table"] + +- Statement[@CanonicalImage = null] + +- UnlabelledStatement[@CanonicalImage = null] + +- DeleteStatement[@CanonicalImage = null] + +- TableReference[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "TEST_TABLE", @Image = "test_table"] + | +- ID[@CanonicalImage = "TEST_TABLE", @Image = "test_table"] + +- ErrorLoggingClause[@CanonicalImage = null] + +- TableName[@CanonicalImage = "ERR$_TEST_TABLE", @Image = "err$_test_table"] + +- ID[@CanonicalImage = "ERR$_TEST_TABLE", @Image = "err$_test_table"] From 9d803282d9bccbbc33783f347ea75d7e715ae120 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 7 Jun 2024 19:24:26 +0200 Subject: [PATCH 116/121] [apex] Use case-insensitive lexer for CPD This makes it consistent with how the ApexParser reads the files. And the case-sensitive ANTLR rules (e.g. for string literals) work that way. Fixes #5053 --- docs/pages/release_notes.md | 2 + .../pmd/lang/apex/cpd/ApexCpdLexer.java | 26 ++++++----- .../pmd/lang/apex/cpd/ApexCpdLexerTest.java | 10 +++++ .../apex/cpd/testdata/StringLiterals5053.cls | 12 ++++++ .../apex/cpd/testdata/StringLiterals5053.txt | 43 +++++++++++++++++++ 5 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.cls create mode 100644 pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e8d7cdbf90..da03f67d36 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 +* apex + * [#5053](https://github.com/pmd/pmd/issues/5053): \[apex] CPD fails to parse string literals with escaped characters ### ๐Ÿšจ API Changes diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexer.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexer.java index f483fca8f4..367b2097e4 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexer.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexer.java @@ -9,37 +9,35 @@ import java.util.Locale; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CharStreams; -import org.antlr.v4.runtime.Token; import net.sourceforge.pmd.cpd.CpdLexer; import net.sourceforge.pmd.cpd.TokenFactory; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrToken; +import net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrTokenManager; import net.sourceforge.pmd.lang.document.TextDocument; import com.nawforce.apexparser.ApexLexer; +import com.nawforce.apexparser.CaseInsensitiveInputStream; public class ApexCpdLexer implements CpdLexer { @Override public void tokenize(TextDocument document, TokenFactory tokenEntries) throws IOException { CharStream charStream = CharStreams.fromReader(document.newReader()); - ApexLexer lexer = new ApexLexer(charStream); + CaseInsensitiveInputStream caseInsensitiveInputStream = new CaseInsensitiveInputStream(charStream); + ApexLexer lexer = new ApexLexer(caseInsensitiveInputStream); + AntlrTokenManager tokenManager = new AntlrTokenManager(lexer, document); - Token token = lexer.nextToken(); + AntlrToken token = tokenManager.getNextToken(); - while (token.getType() != Token.EOF) { - if (token.getChannel() == ApexLexer.DEFAULT_TOKEN_CHANNEL) { // exclude WHITESPACE_CHANNEL and COMMENT_CHANNEL - String tokenText = token.getText(); + while (!token.isEof()) { + if (token.isDefault()) { // excludes WHITESPACE_CHANNEL and COMMENT_CHANNEL + String tokenText = token.getImage(); // be case-insensitive tokenText = tokenText.toLowerCase(Locale.ROOT); - tokenEntries.recordToken( - tokenText, - token.getLine(), - token.getCharPositionInLine() + 1, - token.getLine(), - token.getCharPositionInLine() + tokenText.length() + 1 - ); + tokenEntries.recordToken(tokenText, token.getReportLocation()); } - token = lexer.nextToken(); + token = tokenManager.getNextToken(); } } } diff --git a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexerTest.java b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexerTest.java index 67c1da6555..7210cbfed7 100644 --- a/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexerTest.java +++ b/pmd-apex/src/test/java/net/sourceforge/pmd/lang/apex/cpd/ApexCpdLexerTest.java @@ -32,4 +32,14 @@ class ApexCpdLexerTest extends CpdTextComparisonTest { void testTabWidth() { doTest("tabWidth"); } + + @Test + void lexExceptionExpected() { + expectLexException("class Foo { String s = \"not a string literal\"; }"); + } + + @Test + void caseInsensitiveStringLiterals() { + doTest("StringLiterals5053"); + } } diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.cls b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.cls new file mode 100644 index 0000000000..a4b7278227 --- /dev/null +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.cls @@ -0,0 +1,12 @@ +/* + * BSD-style license; for more info see http://pmd.sourceforge.net/license.html + */ + +// See https://github.com/pmd/pmd/issues/5053 + +public with sharing class PMD7CPD { + public static void example(){ + String str = 'alice'; + str = str.replace('alice', 'dan' + '\u00A0' + '"100%"'); + } +} diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt new file mode 100644 index 0000000000..d6204d7fed --- /dev/null +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/cpd/testdata/StringLiterals5053.txt @@ -0,0 +1,43 @@ + [Image] or [Truncated image[ Bcol Ecol +L7 + [public] 1 7 + [with] 8 12 + [sharing] 13 20 + [class] 21 26 + [pmd7cpd] 27 34 + [{] 35 36 +L8 + [public] 5 11 + [static] 12 18 + [void] 19 23 + [example] 24 31 + [(] 31 32 + [)] 32 33 + [{] 33 34 +L9 + [string] 7 13 + [str] 14 17 + [=] 18 19 + ['alice'] 20 27 + [;] 27 28 +L10 + [str] 7 10 + [=] 11 12 + [str] 13 16 + [.] 16 17 + [replace] 17 24 + [(] 24 25 + ['alice'] 25 32 + [,] 32 33 + ['dan - 25 + 26-SNAPSHOT 7.2.0 ${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar